diff options
author | 2019-09-17 17:17:55 -0400 | |
---|---|---|
committer | 2019-09-17 17:17:55 -0400 | |
commit | 3411bc6185fad2a06f786fafdd3e6fa7408c4909 (patch) | |
tree | 4f3a351da7f4f29f0101940c7f0372ca60493298 | |
parent | 24252e0776fb33b90497cf3d9b07ba38152b65b3 (diff) |
Fixed scroll issues when toggling line wrap.
The current line should always remain visible.
-rw-r--r-- | modules/textadept/menu.lua | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index 2cd738d3..55371b4e 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -297,7 +297,10 @@ local default_menubar = { buffer.view_eol = not buffer.view_eol end}, {_L['Toggle _Wrap Mode'], function() + local first_visible_line = buffer.first_visible_line + local display_line = buffer:visible_from_doc_line(first_visible_line) buffer.wrap_mode = buffer.wrap_mode == 0 and buffer.WRAP_WHITESPACE or 0 + buffer:line_scroll(0, first_visible_line - display_line) end}, {_L['Toggle View White_space'], function() buffer.view_ws = buffer.view_ws == 0 and buffer.WS_VISIBLEALWAYS or 0 |