From 4ca29592357e698959441392a9e7b9b38dcf38c0 Mon Sep 17 00:00:00 2001 From: mitchell <70453897+667e-11@users.noreply.github.com> Date: Thu, 12 Mar 2015 16:52:40 -0400 Subject: Lua code cleanup. --- modules/textadept/bookmarks.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'modules/textadept/bookmarks.lua') diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index 0dd7e0fe..7ced37c7 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -30,9 +30,7 @@ end --- -- Clears all bookmarks in the current buffer. -- @name clear -function M.clear() - buffer:marker_delete_all(M.MARK_BOOKMARK) -end +function M.clear() buffer:marker_delete_all(M.MARK_BOOKMARK) end --- -- Prompts the user to select a bookmarked line to move the caret to the @@ -45,14 +43,13 @@ end -- @name goto_mark function M.goto_mark(next) if next == nil then - local buffer = buffer local marks, line = {}, buffer:marker_next(0, 2^M.MARK_BOOKMARK) if line == -1 then return end - repeat + while line >= 0 do local text = buffer:get_line(line):match('^[^\r\n]*') marks[#marks + 1] = tostring(line + 1)..': '..text line = buffer:marker_next(line + 1, 2^M.MARK_BOOKMARK) - until line < 0 + end local button, i = ui.dialogs.filteredlist{ title = _L['Select Bookmark'], columns = _L['Bookmark'], items = marks } -- cgit v1.2.3