diff options
author | rxi <rxi@users.noreply.github.com> | 2020-05-07 21:38:48 +0100 |
---|---|---|
committer | rxi <rxi@users.noreply.github.com> | 2020-05-07 21:38:48 +0100 |
commit | 2448a95e99d57bda61d0b6e7596f6829be5d457a (patch) | |
tree | 883b399b6436fb006ded8fb6cc5f9def19ea325d /plugins | |
parent | 953426062d06a950a42f58896c41ba5ff008ed98 (diff) | |
download | lite-xl-plugins-2448a95e99d57bda61d0b6e7596f6829be5d457a.tar.gz lite-xl-plugins-2448a95e99d57bda61d0b6e7596f6829be5d457a.zip |
Changed selectionhighlight plugin to use doc.lines array
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/selectionhighlight.lua | 4 |
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) |