diff options
-rw-r--r-- | README.md | 1 | ||||
-rw-r--r-- | plugins/linecopypaste.lua | 50 |
2 files changed, 0 insertions, 51 deletions
@@ -127,7 +127,6 @@ _Note: if you make a pull request, the table should be updated and kept in alpha | [`language_yaml`](plugins/language_yaml.lua?raw=1) | Syntax for [YAML](https://yaml.org/) serialization language | | [`language_zig`](plugins/language_zig.lua?raw=1) | Syntax for the [Zig](https://ziglang.org/) programming language | | [`lfautoinsert`](plugins/lfautoinsert.lua?raw=1) | Automatically inserts indentation and closing bracket/text after newline | -| [`linecopypaste`](plugins/linecopypaste.lua?raw=1) | Copy, cut and paste the current line when nothing is selected | | [`linenumbers`](plugins/linenumbers.lua?raw=1) | The ability to change the display of the line number _([screenshot](https://user-images.githubusercontent.com/5556081/129493788-6a4cbd7a-9074-4133-bab7-110ed55f18f7.png))_ | | [`lint+`](https://github.com/liquid600pgm/lintplus)\* | Advanced linter with ErrorLens-like error reporting. Compatible with linters made for `linter` _([screenshot](https://raw.githubusercontent.com/liquid600pgm/lintplus/master/screenshots/1.png))_ | | [`linter`](https://github.com/drmargarido/linters)\* | Linters for multiple languages | 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
|