Make cursor_clipboard globa, not per doc

This commit is contained in:
Jipok
2021-12-08 17:34:10 +05:00
parent acc7ceefd4
commit 4eee123eff
3 changed files with 25 additions and 16 deletions
+1 -3
View File
@@ -33,8 +33,6 @@ end
function Doc:reset()
self.lines = { "\n" }
self.selections = { 1, 1, 1, 1 }
self.cursor_clipboard = {}
self.cursor_clipboard_whole_line = {}
self.undo_stack = { idx = 1 }
self.redo_stack = { idx = 1 }
self.clean_change_id = 1
@@ -199,7 +197,7 @@ function Doc:add_selection(line1, col1, line2, col2, swap)
end
function Doc:set_selection(line1, col1, line2, col2, swap)
self.selections, self.cursor_clipboard = {}, {}
self.selections = {}
self:set_selections(1, line1, col1, line2, col2, swap)
end