diff options
author | 2009-02-21 19:44:49 -0500 | |
---|---|---|
committer | 2009-02-21 19:44:49 -0500 | |
commit | bf1111fc2c782ac257d47d834046f3a7316d3165 (patch) | |
tree | caf9173de2e16fcdcdfba727ab5c10869a6b8bbf /modules/textadept/bookmarks.lua | |
parent | 45964890d8250b6021ed336533c231bee76c67b6 (diff) | |
download | textadept-bf1111fc2c782ac257d47d834046f3a7316d3165.tar.gz textadept-bf1111fc2c782ac257d47d834046f3a7316d3165.zip |
Fixed toggle bookmark bug, wrap searches; modules/textadept/bookmarks.lua
Diffstat (limited to 'modules/textadept/bookmarks.lua')
-rw-r--r-- | modules/textadept/bookmarks.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index 075f51fd..78f95b13 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -38,7 +38,8 @@ function toggle() local buffer = buffer local line = buffer:line_from_position(buffer.current_pos) local markers = buffer:marker_get(line) -- bit mask - if markers % 2 == 0 then add() else remove() end -- first bit is set? + local bit = 2^MARK_BOOKMARK + if markers % (bit + bit) < bit then add() else remove() end end --- @@ -54,6 +55,7 @@ function goto_next() local buffer = buffer local current_line = buffer:line_from_position(buffer.current_pos) local line = buffer:marker_next(current_line + 1, 2^MARK_BOOKMARK) + if line == -1 then line = buffer:marker_next(0, 2^MARK_BOOKMARK) end if line >= 0 then _m.textadept.editing.goto_line(line + 1) end end @@ -63,5 +65,8 @@ function goto_prev() local buffer = buffer local current_line = buffer:line_from_position(buffer.current_pos) local line = buffer:marker_previous(current_line - 1, 2^MARK_BOOKMARK) + if line == -1 then + line = buffer:marker_previous(buffer.line_count, 2^MARK_BOOKMARK) + end if line >= 0 then _m.textadept.editing.goto_line(line + 1) end end |