bugfix: cut (C-x) without first selecting anything
This commit is contained in:
parent
6ba10b4de6
commit
4476eb8946
|
@ -36,6 +36,9 @@ persistence:
|
||||||
draw a line, circle, rectangle, square, polygon, quit, restart. All the shapes you drew should still be visible.
|
draw a line, circle, rectangle, square, polygon, quit, restart. All the shapes you drew should still be visible.
|
||||||
select a point and name it, quit, restart. Name is still visible.
|
select a point and name it, quit, restart. Name is still visible.
|
||||||
|
|
||||||
|
clipboard:
|
||||||
|
cut/copy without making a selection
|
||||||
|
|
||||||
resize:
|
resize:
|
||||||
create a file containing a long line of characters without spaces. try
|
create a file containing a long line of characters without spaces. try
|
||||||
resizing the window vertically and horizontally, as far as possible.
|
resizing the window vertically and horizontally, as far as possible.
|
||||||
|
|
|
@ -103,12 +103,14 @@ function Text.to_pos(x,y)
|
||||||
end
|
end
|
||||||
|
|
||||||
function Text.cut_selection()
|
function Text.cut_selection()
|
||||||
|
if Selection1.line == nil then return end
|
||||||
local result = Text.selection()
|
local result = Text.selection()
|
||||||
Text.delete_selection()
|
Text.delete_selection()
|
||||||
return result
|
return result
|
||||||
end
|
end
|
||||||
|
|
||||||
function Text.delete_selection()
|
function Text.delete_selection()
|
||||||
|
if Selection1.line == nil then return end
|
||||||
local minl,maxl = minmax(Selection1.line, Cursor1.line)
|
local minl,maxl = minmax(Selection1.line, Cursor1.line)
|
||||||
local before = snapshot(minl, maxl)
|
local before = snapshot(minl, maxl)
|
||||||
Text.delete_selection_without_undo()
|
Text.delete_selection_without_undo()
|
||||||
|
|
Loading…
Reference in New Issue