aboutsummaryrefslogtreecommitdiff
path: root/plugins/linecopypaste.lua
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-08-22 22:23:58 -0400
committerjgmdev <jgmdev@gmail.com>2022-08-22 22:33:55 -0400
commit6700c4f5c1fd11938de379592e191302e0026bea (patch)
tree6d6acca977d557b6723d276c8068891accc1086b /plugins/linecopypaste.lua
parent0ef2e01e13ccf0307dbc60cff9a5296736525acb (diff)
downloadlite-xl-plugins-6700c4f5c1fd11938de379592e191302e0026bea.tar.gz
lite-xl-plugins-6700c4f5c1fd11938de379592e191302e0026bea.zip
removed linecopypaste as it is now part of core
Diffstat (limited to 'plugins/linecopypaste.lua')
-rw-r--r--plugins/linecopypaste.lua50
1 files changed, 0 insertions, 50 deletions
diff --git a/plugins/linecopypaste.lua b/plugins/linecopypaste.lua
deleted file mode 100644
index 7be8492..0000000
--- a/plugins/linecopypaste.lua
+++ /dev/null
@@ -1,50 +0,0 @@
--- mod-version:3
-local core = require "core"
-local command = require "core.command"
-
-local function doc()
- return core.active_view.doc
-end
-
-local line_in_clipboard = false
-
-local doc_copy = command.map["doc:copy"].perform
-command.map["doc:copy"].perform = function()
- if doc():has_selection() then
- doc_copy()
- line_in_clipboard = false
- else
- local line = doc():get_selection()
- system.set_clipboard(doc().lines[line])
- line_in_clipboard = true
- end
-end
-
-local doc_cut = command.map["doc:cut"].perform
-command.map["doc:cut"].perform = function()
- if doc():has_selection() then
- doc_cut()
- line_in_clipboard = false
- else
- local line = doc():get_selection()
- system.set_clipboard(doc().lines[line])
- if line < #(doc().lines) then
- doc():remove(line, 1, line+1, 1)
- else -- last line in file
- doc():remove(line, 1, line, #(doc().lines[line]))
- end
- doc():set_selection(line, 1)
- line_in_clipboard = true
- end
-end
-
-local doc_paste = command.map["doc:paste"].perform
-command.map["doc:paste"].perform = function()
- if line_in_clipboard == false then
- doc_paste()
- else
- local line, col = doc():get_selection()
- doc():insert(line, 1, system.get_clipboard():gsub("\r", ""))
- doc():set_selection(line+1, col)
- end
-end