diff options
author | 2019-08-07 11:05:36 -0400 | |
---|---|---|
committer | 2019-08-07 11:05:36 -0400 | |
commit | 88a5038c37ba95bab25742f2805fea75f329c67e (patch) | |
tree | be663f8eecba696f6139141d95a2e1e075c2621a /core/ui.lua | |
parent | f378f0379a3cacd19a952d81896733354a69d34a (diff) |
Improve caret sticky behavior when switching between buffers.
This works best with buffer.CARET_STICKY_OFF. For any other sticky setting, the
last x position may be lost (e.g. when set by mouse click, inserted indentation,
etc.).
Diffstat (limited to 'core/ui.lua')
-rw-r--r-- | core/ui.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/ui.lua b/core/ui.lua index a19785c9..9f940e32 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -352,6 +352,7 @@ events_connect(events.BUFFER_AFTER_SWITCH, function() for i = 1, #buffer._folds do buffer:toggle_fold(buffer._folds[i]) end -- Restore view state. buffer:set_sel(buffer._anchor, buffer._current_pos) + buffer:choose_caret_x() buffer:line_scroll(0, buffer:visible_from_doc_line(buffer._top_line) - buffer.first_visible_line) buffer.x_offset = buffer._x_offset or 0 |