about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-06-09 07:29:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-06-09 07:29:38 -0700
commit4ad51d648bdfe4f56cbca5f54a8ce42dda384aa7 (patch)
treecff63071d93dda53f36b022c452b2b8d87c6c306
parente77157d316cde82faaa52dabfa66cd3253cb8abf (diff)
downloadview.love-4ad51d648bdfe4f56cbca5f54a8ce42dda384aa7.tar.gz
move
-rw-r--r--select.lua12
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