aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/edit.c
diff options
context:
space:
mode:
authorBjörn Linse <bjorn.linse@gmail.com>2019-01-13 12:10:26 +0100
committerGitHub <noreply@github.com>2019-01-13 12:10:26 +0100
commita7fc01a532e753e2f5a7d0f2b8f670144d78a878 (patch)
tree36060b7fdfb919a7f36faf0dad9790a95088c0e7 /src/nvim/edit.c
parent424388c207eaf6b5f564ff8247b5800ab337bc56 (diff)
parent23c71d5182a5e717c3a1852d9d3c90e81b4735fd (diff)
downloadrneovim-a7fc01a532e753e2f5a7d0f2b8f670144d78a878.tar.gz
rneovim-a7fc01a532e753e2f5a7d0f2b8f670144d78a878.tar.bz2
rneovim-a7fc01a532e753e2f5a7d0f2b8f670144d78a878.zip
Merge pull request #9492 from bfredl/cul_cole
redraw: share more code between cursorline and conceal redraws. Add tests for conceal cursor
Diffstat (limited to 'src/nvim/edit.c')
-rw-r--r--src/nvim/edit.c28
1 files changed, 5 insertions, 23 deletions
diff --git a/src/nvim/edit.c b/src/nvim/edit.c
index 257a6ef112..bb3c0ec196 100644
--- a/src/nvim/edit.c
+++ b/src/nvim/edit.c
@@ -306,10 +306,6 @@ static void insert_enter(InsertState *s)
}
}
- // Check if the cursor line needs redrawing before changing State. If
- // 'concealcursor' is "n" it needs to be redrawn without concealing.
- conceal_check_cursor_line();
-
// When doing a paste with the middle mouse button, Insstart is set to
// where the paste started.
if (where_paste_started.lnum != 0) {
@@ -1381,9 +1377,7 @@ ins_redraw (
int ready /* not busy with something */
)
{
- linenr_T conceal_old_cursor_line = 0;
- linenr_T conceal_new_cursor_line = 0;
- int conceal_update_lines = FALSE;
+ bool conceal_cursor_moved = false;
if (char_avail())
return;
@@ -1406,11 +1400,7 @@ ins_redraw (
update_curswant();
ins_apply_autocmds(EVENT_CURSORMOVEDI);
}
- if (curwin->w_p_cole > 0) {
- conceal_old_cursor_line = last_cursormoved.lnum;
- conceal_new_cursor_line = curwin->w_cursor.lnum;
- conceal_update_lines = TRUE;
- }
+ conceal_cursor_moved = true;
last_cursormoved = curwin->w_cursor;
}
@@ -1452,17 +1442,9 @@ ins_redraw (
}
}
- if ((conceal_update_lines
- && (conceal_old_cursor_line != conceal_new_cursor_line
- || conceal_cursor_line(curwin)))
- || need_cursor_line_redraw) {
- if (conceal_old_cursor_line != conceal_new_cursor_line) {
- redrawWinline(curwin, conceal_old_cursor_line);
- }
- redrawWinline(curwin, conceal_new_cursor_line == 0
- ? curwin->w_cursor.lnum : conceal_new_cursor_line);
- curwin->w_valid &= ~VALID_CROW;
- need_cursor_line_redraw = false;
+ if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)
+ && conceal_cursor_moved) {
+ redrawWinline(curwin, curwin->w_cursor.lnum);
}
if (must_redraw) {