about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-07-31 08:21:38 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-07-31 08:21:38 -0700
commit484b76f5c6984f4d3a745d9fb36dd55cefb97c06 (patch)
tree6932e2adeffebbd7c30c9ded260b37af48ac99fd
parent52ba030eaa7e984aab969359d19ba48b4c483271 (diff)
downloadlines.love-484b76f5c6984f4d3a745d9fb36dd55cefb97c06.tar.gz
improve a comment
-rw-r--r--source_text.lua2
-rw-r--r--text.lua2
2 files changed, 2 insertions, 2 deletions
diff --git a/source_text.lua b/source_text.lua
index 1a42310..b3d4963 100644
--- a/source_text.lua
+++ b/source_text.lua
@@ -51,8 +51,8 @@ function Text.draw(State, line_index, y, startpos, hide_cursor)
         App.screen.print(frag, x,y)
         x = x+App.width(frag)
       end
-      -- render cursor if necessary
       if not hide_cursor and line_index == State.cursor1.line then
+        -- render search highlight or cursor
         if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
           if State.search_term then
             local data = State.lines[State.cursor1.line].data
diff --git a/text.lua b/text.lua
index d89fb63..9762365 100644
--- a/text.lua
+++ b/text.lua
@@ -29,8 +29,8 @@ function Text.draw(State, line_index, y, startpos)
       end
       App.color(Text_color)
       App.screen.print(screen_line, State.left,y)
-      -- render cursor if necessary
       if line_index == State.cursor1.line then
+        -- render search highlight or cursor
         if pos <= State.cursor1.pos and pos + frag_len >= State.cursor1.pos then
           if State.search_term then
             local data = State.lines[State.cursor1.line].data