diff --git a/TODO b/TODO index 16d66e3..cf99a15 100644 --- a/TODO +++ b/TODO @@ -31,5 +31,5 @@ [ ] add multi cursor system [ ] add binding to open up a cheatsheet of keybinding, with a search feature -[ ] implement visual "ruler" at column 80 +[x] implement visual "ruler" at column 80 [ ] show hidden files config and binding diff --git a/data/core/docview.lua b/data/core/docview.lua index 73191c2..58a1586 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -305,6 +305,10 @@ end function DocView:draw_line_body(idx, x, y) local line, col = self.doc:get_selection() + local sw = self:get_font():get_width(" ") + local w = math.ceil(1 * SCALE) + local lh = self:get_line_height() + local color = style.guide or style.selection -- draw selection if it overlaps this line local line1, col1, line2, col2 = self.doc:get_selection(true) @@ -324,6 +328,9 @@ function DocView:draw_line_body(idx, x, y) self:draw_line_highlight(x + self.scroll.x, y) end + -- draw ruler + renderer.draw_rect(x + config.line_limit * sw, y, sw, lh, color) + -- draw line's text self:draw_line_text(idx, x, y) diff --git a/src/main.c b/src/main.c index d599118..c4a9b45 100644 --- a/src/main.c +++ b/src/main.c @@ -65,7 +65,6 @@ int main(int argc, char **argv) init_window_icon(); ren_init(window); - lua_State *L = luaL_newstate(); luaL_openlibs(L); api_load_libs(L);