diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/dged/window.c | 9 | ||||
| -rw-r--r-- | src/main/search-replace.c | 9 |
2 files changed, 8 insertions, 10 deletions
diff --git a/src/dged/window.c b/src/dged/window.c index 91b1735..a25154a 100644 --- a/src/dged/window.c +++ b/src/dged/window.c @@ -186,7 +186,6 @@ void windows_update(void *(*frame_alloc)(size_t), uint64_t frame_time) { const uint32_t hpadding = 1; const uint32_t border_width = 1; - const uint32_t shadow_width = 1; bool draw_padding = false, draw_borders = false; @@ -257,14 +256,6 @@ void windows_update(void *(*frame_alloc)(size_t), uint64_t frame_time) { x += border_width; } - // shadow - /*command_list_set_index_color_bg(w->commands, 236); - command_list_draw_repeated(w->commands, 1, w->height + vmargins, ' ', - w->width + margins * 2); for (uint32_t line = 1; line < w->height; ++line) { - command_list_draw_repeated(w->commands, w->width + margins * 2, line, ' ', - shadow_width); - }*/ - struct command_list *inner = command_list_create( w->height * w->width, frame_alloc, w_x + x, w_y + y, "bufview-popup"); diff --git a/src/main/search-replace.c b/src/main/search-replace.c index a94e2b1..c1b812f 100644 --- a/src/main/search-replace.c +++ b/src/main/search-replace.c @@ -33,7 +33,13 @@ uint64_t matchdist(struct region *match, struct location loc) { struct location begin = match->begin; int64_t linedist = (int64_t)begin.line - (int64_t)loc.line; - int64_t coldist = (int64_t)begin.col - (int64_t)loc.col; + + // if the match is on a different line, score it by how far + // into the line it is, otherwise check the distance from location + int64_t coldist = begin.col; + if (linedist == 0) { + int64_t coldist = (int64_t)begin.col - (int64_t)loc.col; + } // arbitrary row scaling, best effort to avoid counting line length return (linedist * linedist) * 1e6 + coldist * coldist; @@ -323,6 +329,7 @@ COMMAND_FN("search-backward", search_backward, search_interactive, int32_t find(struct command_ctx ctx, int argc, const char *argv[]) { bool reverse = *(bool *)ctx.userdata; if (argc == 0) { + g_last_search_interactive = false; struct binding bindings[] = { ANONYMOUS_BINDING(Ctrl, 'S', &search_forward_command), ANONYMOUS_BINDING(Ctrl, 'R', &search_backward_command), |
