about summary refs log tree commit diff stats
path: root/select.lua
diff options
context:
space:
mode:
Diffstat (limited to 'select.lua')
-rw-r--r--select.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/select.lua b/select.lua
index d37ec61..f818c23 100644
--- a/select.lua
+++ b/select.lua
@@ -57,11 +57,11 @@ function Text.draw_highlight(State, line, x,y, pos, lo,hi)
       lo_px = 0
     else
       local before = line.data:sub(pos_offset, lo_offset-1)
-      lo_px = App.width(before)
+      lo_px = State.font:getWidth(before)
     end
     local s = line.data:sub(lo_offset, hi_offset-1)
     App.color(Highlight_color)
-    love.graphics.rectangle('fill', x+lo_px,y, App.width(s),State.line_height)
+    love.graphics.rectangle('fill', x+lo_px,y, State.font:getWidth(s),State.line_height)
     App.color(Text_color)
     return lo_px
   end