From b22bfe82dbd3ef91c47ff0e43a845f55916796c2 Mon Sep 17 00:00:00 2001 From: "Kartik K. Agaram" Date: Mon, 30 May 2022 15:40:36 -0700 Subject: support non-text lines in Text.to2 Originally I was only using it on cursor line, but there's no reason that has to be true in general. --- text.lua | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'text.lua') diff --git a/text.lua b/text.lua index c4b9163..fe95772 100644 --- a/text.lua +++ b/text.lua @@ -1737,7 +1737,9 @@ function Text.x(s, pos) end function Text.to2(pos1) - assert(Lines[pos1.line].mode == 'text') + if Lines[pos1.line].mode == 'drawing' then + return {line=pos1.line, screen_line=1, screen_pos=1} + end local result = {line=pos1.line, screen_line=1} if Lines[pos1.line].screen_line_starting_pos == nil then result.screen_pos = pos1.pos -- cgit 1.4.1-2-gfad0