aboutsummaryrefslogtreecommitdiff
path: root/plugins/selectionhighlight.lua
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/selectionhighlight.lua')
-rw-r--r--plugins/selectionhighlight.lua4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugins/selectionhighlight.lua b/plugins/selectionhighlight.lua
index 5404ce7..93dfe17 100644
--- a/plugins/selectionhighlight.lua
+++ b/plugins/selectionhighlight.lua
@@ -19,8 +19,8 @@ function DocView:draw_line_body(idx, x, y)
local line1, col1, line2, col2 = self.doc:get_selection(true)
if line1 == line2 and col1 ~= col2 then
local lh = self:get_line_height()
- local selected_text = self:get_cached_line(line1).text:sub(col1, col2 - 1)
- local current_line_text = self:get_cached_line(idx).text
+ local selected_text = self.doc.lines[line1]:sub(col1, col2 - 1)
+ local current_line_text = self.doc.lines[idx]
local last_col = 1
while true do
local start_col, end_col = current_line_text:find(selected_text, last_col, true)