diff options
author | Kartik K. Agaram <vc@akkartik.com> | 2022-06-09 07:29:38 -0700 |
---|---|---|
committer | Kartik K. Agaram <vc@akkartik.com> | 2022-06-09 07:29:38 -0700 |
commit | 4ad51d648bdfe4f56cbca5f54a8ce42dda384aa7 (patch) | |
tree | cff63071d93dda53f36b022c452b2b8d87c6c306 | |
parent | e77157d316cde82faaa52dabfa66cd3253cb8abf (diff) | |
download | view.love-4ad51d648bdfe4f56cbca5f54a8ce42dda384aa7.tar.gz |
move
-rw-r--r-- | select.lua | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/select.lua b/select.lua index 57791d5..1121085 100644 --- a/select.lua +++ b/select.lua @@ -102,6 +102,12 @@ function Text.to_pos(x,y) end end +function Text.cut_selection() + local result = Text.selection() + Text.delete_selection() + return result +end + function Text.delete_selection() local minl,maxl = minmax(Selection1.line, Cursor1.line) local before = snapshot(minl, maxl) @@ -172,9 +178,3 @@ function Text.selection() table.insert(result, Lines[maxl].data:sub(1, max_offset-1)) return table.concat(result, '\n') end - -function Text.cut_selection() - local result = Text.selection() - Text.delete_selection() - return result -end |