diff options
author | Guldoman <giulio.lettieri@gmail.com> | 2022-04-30 06:30:01 +0200 |
---|---|---|
committer | Guldoman <giulio.lettieri@gmail.com> | 2022-04-30 06:30:01 +0200 |
commit | 844f8abc445a46aba3c4988518d4ea309417cb46 (patch) | |
tree | 0cbae8b0822faaf0ec77537cdbe457e18571d73b /plugins | |
parent | 9e15d93909096a14b43fc8e2e098ba9ef734e166 (diff) | |
download | lite-xl-plugins-844f8abc445a46aba3c4988518d4ea309417cb46.tar.gz lite-xl-plugins-844f8abc445a46aba3c4988518d4ea309417cb46.zip |
`selectionhighlight`: Don't draw box around the selection
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/selectionhighlight.lua | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/plugins/selectionhighlight.lua b/plugins/selectionhighlight.lua index 25a6125..19bc475 100644 --- a/plugins/selectionhighlight.lua +++ b/plugins/selectionhighlight.lua @@ -31,10 +31,13 @@ function DocView:draw_line_body(idx, x, y) selected_text, last_col, true ) if start_col == nil then break end - local x1 = x + self:get_col_x_offset(idx, start_col) - local x2 = x + self:get_col_x_offset(idx, end_col + 1) - local color = style.selectionhighlight or style.syntax.comment - draw_box(x1, y, x2 - x1, lh, color) + -- don't draw box around the selection + if idx ~= line1 or start_col ~= col1 then + local x1 = x + self:get_col_x_offset(idx, start_col) + local x2 = x + self:get_col_x_offset(idx, end_col + 1) + local color = style.selectionhighlight or style.syntax.comment + draw_box(x1, y, x2 - x1, lh, color) + end last_col = end_col + 1 end end |