diff --git a/TODO b/TODO index 995d895..5abe9fd 100644 --- a/TODO +++ b/TODO @@ -16,6 +16,7 @@ [ ] that command can be what is selected [ ] console: accept input [ ] doc: detect file changes with hash +[ ] add horizontal scroll [ ] add a cross to close tab [ ] add context menu to various things [ ] document and selection context menu @@ -53,3 +54,4 @@ [x] implement visual "ruler" at column 80 [ ] show hidden files config and binding [ ] syntax: highlight FIXME TODO BUG FIX and IMPROVEMENT keywords +[ ] do not open doc in new tab if current tab has an unchanged document diff --git a/data/core/docview.lua b/data/core/docview.lua index 849595b..eb81e9c 100644 --- a/data/core/docview.lua +++ b/data/core/docview.lua @@ -331,7 +331,7 @@ function DocView:draw_line_body(idx, x, y) local w = math.ceil(1 * SCALE) local lh = self:get_line_height() local color = style.guide or style.selection - renderer.draw_rect(x + config.line_limit * sw, y, sw, lh, color) + renderer.draw_rect(x + config.line_limit * sw, y, w, lh, color) end -- draw line's text diff --git a/src/main.c b/src/main.c index cf018a5..c76b097 100644 --- a/src/main.c +++ b/src/main.c @@ -2,18 +2,26 @@ #include #include +#include #include #include "api/api.h" #include "renderer.h" +#define MAX(a,b) ((a)>(b)?(a):(b)) + +// TODO: configuration here is required +#define FONT_14PT_SIZE_MM 3 + SDL_Window *window; static double get_scale(void) { - float dpi; + float dpi, s; SDL_GetDisplayDPI(0, NULL, &dpi, NULL); - return 1.0; + s = (1.0/dpi)*25.4; // size of a point + // as per standard 14 point should be 3mm + return floor((FONT_14PT_SIZE_MM/(14*s))*10)/10.0; } static void get_exe_filename(char *buf, int sz)