about summary refs log tree commit diff stats
path: root/source_text.lua
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2023-09-15 13:30:42 -0700
committerKartik K. Agaram <vc@akkartik.com>2023-09-15 13:30:42 -0700
commit76f119b7b996c5751a42bf09b1a234b98aa6d48b (patch)
tree0d6180c0de87bd8221c7d6b64b23c2ad4b6edde8 /source_text.lua
parentab5ba3f3e5f4f1f1583d798ace26683cb572ed18 (diff)
downloadlines.love-76f119b7b996c5751a42bf09b1a234b98aa6d48b.tar.gz
hide line numbers from log browser
Diffstat (limited to 'source_text.lua')
-rw-r--r--source_text.lua8
1 files changed, 5 insertions, 3 deletions
diff --git a/source_text.lua b/source_text.lua
index 68b560e..df36266 100644
--- a/source_text.lua
+++ b/source_text.lua
@@ -3,7 +3,7 @@ Text = {}
 
 -- draw a line starting from startpos to screen at y between State.left and State.right
 -- return y for the next line, and position of start of final screen line drawn
-function Text.draw(State, line_index, y, startpos, hide_cursor)
+function Text.draw(State, line_index, y, startpos, hide_cursor, show_line_numbers)
   local line = State.lines[line_index]
   local line_cache = State.line_cache[line_index]
   line_cache.starty = y
@@ -12,8 +12,10 @@ function Text.draw(State, line_index, y, startpos, hide_cursor)
   local final_screen_line_starting_pos = startpos  -- track value to return
   Text.populate_screen_line_starting_pos(State, line_index)
   Text.populate_link_offsets(State, line_index)
-  App.color(Line_number_color)
-  love.graphics.print(line_index, State.left-Line_number_width*App.width('m')+10,y)
+  if show_line_numbers then
+    App.color(Line_number_color)
+    love.graphics.print(line_index, State.left-Line_number_width*App.width('m')+10,y)
+  end
   initialize_color()
   assert(#line_cache.screen_line_starting_pos >= 1)
   for i=1,#line_cache.screen_line_starting_pos do