diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2015-04-07 14:08:06 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2015-04-07 14:08:06 +0200 |
| commit | 0ec4c6896358fa49364a9c2e11f982bd31f825d4 (patch) | |
| tree | d39be0f3ba34285b1e5b82dfee5617243f4b55ec /window.c | |
| parent | 5e39e55f075b5ca559cd02c03605ff763a8b6744 (diff) | |
| download | vis-0ec4c6896358fa49364a9c2e11f982bd31f825d4.tar.gz vis-0ec4c6896358fa49364a9c2e11f982bd31f825d4.tar.xz | |
Show cursor in visual mode
Diffstat (limited to 'window.c')
| -rw-r--r-- | window.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -76,7 +76,6 @@ void window_selection_clear(Win *win) { win->sel = text_range_empty(); window_draw(win); window_cursor_update(win); - curs_set(1); } /* reset internal window data structures (cell matrix, line offsets etc.) */ @@ -120,8 +119,11 @@ Filerange window_selection_get(Win *win) { } void window_selection_set(Win *win, Filerange *sel) { + Cursor *cursor = &win->cursor; win->sel = *sel; window_draw(win); + if (win->ui) + win->ui->cursor_to(win->ui, cursor->col, cursor->row); } Filerange window_viewport_get(Win *win) { @@ -841,9 +843,10 @@ void window_scroll_to(Win *win, size_t pos) { void window_selection_start(Win *win) { if (win->sel.start != EPOS && win->sel.end != EPOS) return; - win->sel.start = win->sel.end = window_cursor_get(win); + size_t pos = window_cursor_get(win); + win->sel.start = win->sel.end = pos; window_draw(win); - curs_set(0); + window_cursor_to(win, pos); } void window_syntax_set(Win *win, Syntax *syntax) { |
