diff options
author | 2015-02-18 13:58:19 -0500 | |
---|---|---|
committer | 2015-02-18 13:58:19 -0500 | |
commit | e269446baaaa881d4d280ebf8c782a29950a5e35 (patch) | |
tree | 3a47edce3660f3d37047084dcf7b0b0d178def91 /core | |
parent | 8ccbe89fb35a9e61a6ef48bb53e52dbbe8297f1b (diff) | |
download | textadept-e269446baaaa881d4d280ebf8c782a29950a5e35.tar.gz textadept-e269446baaaa881d4d280ebf8c782a29950a5e35.zip |
Consider some view-specific properties as buffer-specific ones.
These include "view_eol", "wrap_mode", "view_ws", "margin_type_n", and
"margin_width_n". The latter two are for preventing clashes between modules that
modify margins on a per-buffer basis.
Diffstat (limited to 'core')
-rw-r--r-- | core/ui.lua | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/ui.lua b/core/ui.lua index efaa13f9..dec028bd 100644 --- a/core/ui.lua +++ b/core/ui.lua @@ -343,6 +343,13 @@ events_connect(events.BUFFER_BEFORE_SWITCH, function() -- Save view state. buffer._anchor, buffer._current_pos = buffer.anchor, buffer.current_pos buffer._top_line = buffer:doc_line_from_visible(buffer.first_visible_line) + buffer._view_eol, buffer._view_ws = buffer.view_eol, buffer.view_ws + buffer._wrap_mode = buffer.wrap_mode + buffer._margin_type_n, buffer._margin_width_n = {}, {} + for i = 0, 4 do + buffer._margin_type_n[i] = buffer.margin_type_n[i] + buffer._margin_width_n[i] = buffer.margin_width_n[i] + end -- Save fold state. buffer._folds = {} local folds, i = buffer._folds, buffer:contracted_fold_next(0) @@ -361,6 +368,12 @@ events_connect(events.BUFFER_AFTER_SWITCH, function() buffer:set_sel(buffer._anchor, buffer._current_pos) buffer:line_scroll(0, buffer:visible_from_doc_line(buffer._top_line) - buffer.first_visible_line) + buffer.view_eol, buffer.view_ws = buffer._view_eol, buffer._view_ws + buffer.wrap_mode = buffer._wrap_mode + for i = 0, 4 do + buffer.margin_type_n[i] = buffer._margin_type_n[i] + buffer.margin_width_n[i] = buffer._margin_width_n[i] + end end) -- Updates titlebar and statusbar. |