about summary refs log tree commit diff stats
path: root/text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-07-20 07:50:33 -0700
committerKartik K. Agaram <vc@akkartik.com>2022-07-20 07:50:33 -0700
commit88013000fc0445496e1c51ee869a0c36088839e2 (patch)
tree79f5261c7de4f1155c0d2f5b00ffbe23b75e57ed /text.lua
parent9f4b41d82949adbad9df0c89b3c92d8c3ac43630 (diff)
downloadlines.love-88013000fc0445496e1c51ee869a0c36088839e2.tar.gz
.
Diffstat (limited to 'text.lua')
-rw-r--r--text.lua2
1 files changed, 2 insertions, 0 deletions
diff --git a/text.lua b/text.lua
index 39b73d8..5a9896f 100644
--- a/text.lua
+++ b/text.lua
@@ -757,6 +757,7 @@ end
 
 -- convert x pixel coordinate to pos
 -- oblivious to wrapping
+-- result: 1 to len+1
 function Text.nearest_cursor_pos(line, x, left)
   if x == 0 then
     return 1
@@ -798,6 +799,7 @@ end
 
 -- return the nearest index of line (in utf8 code points) which lies entirely
 -- within x pixels of the left margin
+-- result: 0 to len+1
 function Text.nearest_pos_less_than(line, x)
 --?   print('', '-- nearest_pos_less_than', line, x)
   local len = utf8.len(line)