Made cut/copy no-op if there is no selection
This commit is contained in:
parent
1be7a32c6b
commit
7046bfca24
|
@ -70,14 +70,18 @@ local commands = {
|
|||
end,
|
||||
|
||||
["doc:cut"] = function()
|
||||
local text = doc():get_text(doc():get_selection())
|
||||
system.set_clipboard(text)
|
||||
doc():delete_to(0)
|
||||
if doc():has_selection() then
|
||||
local text = doc():get_text(doc():get_selection())
|
||||
system.set_clipboard(text)
|
||||
doc():delete_to(0)
|
||||
end
|
||||
end,
|
||||
|
||||
["doc:copy"] = function()
|
||||
local text = doc():get_text(doc():get_selection())
|
||||
system.set_clipboard(text)
|
||||
if doc():has_selection() then
|
||||
local text = doc():get_text(doc():get_selection())
|
||||
system.set_clipboard(text)
|
||||
end
|
||||
end,
|
||||
|
||||
["doc:paste"] = function()
|
||||
|
|
Loading…
Reference in a new issue