aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
Diffstat (limited to 'plugins')
-rw-r--r--plugins/language_rivet.lua3
-rw-r--r--plugins/selectionhighlight.lua13
2 files changed, 10 insertions, 6 deletions
diff --git a/plugins/language_rivet.lua b/plugins/language_rivet.lua
index b291749..9aa3462 100644
--- a/plugins/language_rivet.lua
+++ b/plugins/language_rivet.lua
@@ -68,6 +68,7 @@ syntax.add {
["mut"] = "keyword",
["unsafe"] = "keyword",
["goto"] = "keyword",
+ ["go"] = "keyword",
["try"] = "keyword",
["orelse"] = "keyword",
["catch"] = "keyword",
@@ -78,6 +79,7 @@ syntax.add {
["and"] = "keyword",
-- types
+ ["ptr"] = "keyword2",
["bool"] = "keyword2",
["i8"] = "keyword2",
["i16"] = "keyword2",
@@ -93,7 +95,6 @@ syntax.add {
["isize"] = "keyword2",
["usize"] = "keyword2",
["str"] = "keyword2",
- ["rawptr"] = "keyword2",
["Self"] = "keyword2",
-- literals
diff --git a/plugins/selectionhighlight.lua b/plugins/selectionhighlight.lua
index 76e0617..19bc475 100644
--- a/plugins/selectionhighlight.lua
+++ b/plugins/selectionhighlight.lua
@@ -17,6 +17,7 @@ end
local draw_line_body = DocView.draw_line_body
function DocView:draw_line_body(idx, x, y)
+ draw_line_body(self, idx, x, y)
local line1, col1, line2, col2 = self.doc:get_selection(true)
if line1 == line2 and col1 ~= col2 then
local selection = self.doc:get_text(line1, col1, line2, col2)
@@ -30,14 +31,16 @@ 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
end
- draw_line_body(self, idx, x, y)
end