aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/core/doc/highlighter.lua2
-rw-r--r--data/core/rootview.lua4
2 files changed, 4 insertions, 2 deletions
diff --git a/data/core/doc/highlighter.lua b/data/core/doc/highlighter.lua
index 718392a1..e7650d01 100644
--- a/data/core/doc/highlighter.lua
+++ b/data/core/doc/highlighter.lua
@@ -46,7 +46,7 @@ end
function Highlighter:invalidate(idx)
- self.first_invalid_line = idx
+ self.first_invalid_line = math.min(self.first_invalid_line, idx)
self.max_wanted_line = math.min(self.max_wanted_line, #self.doc.lines)
end
diff --git a/data/core/rootview.lua b/data/core/rootview.lua
index 0b505663..389525f6 100644
--- a/data/core/rootview.lua
+++ b/data/core/rootview.lua
@@ -349,7 +349,9 @@ function Node:draw_tabs()
color = style.text
end
core.push_clip_rect(x, y, w, h)
- common.draw_text(style.font, color, text, "center", x, y, w, h)
+ x, w = x + style.padding.x, w - style.padding.x * 2
+ local align = style.font:get_width(text) > w and "left" or "center"
+ common.draw_text(style.font, color, text, align, x, y, w, h)
core.pop_clip_rect()
end