mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 03:48:18 +00:00
refactor: remove redundant check for w_p_cole (#17944)
No longer needed after #17890.
This commit is contained in:
@@ -1486,7 +1486,7 @@ static void ins_redraw(bool ready)
|
|||||||
|
|
||||||
// Trigger CursorMoved if the cursor moved. Not when the popup menu is
|
// Trigger CursorMoved if the cursor moved. Not when the popup menu is
|
||||||
// visible, the command might delete it.
|
// visible, the command might delete it.
|
||||||
if (ready && (has_event(EVENT_CURSORMOVEDI) || curwin->w_p_cole > 0)
|
if (ready && has_event(EVENT_CURSORMOVEDI)
|
||||||
&& !equalpos(curwin->w_last_cursormoved, curwin->w_cursor)
|
&& !equalpos(curwin->w_last_cursormoved, curwin->w_cursor)
|
||||||
&& !pum_visible()) {
|
&& !pum_visible()) {
|
||||||
// Need to update the screen first, to make sure syntax
|
// Need to update the screen first, to make sure syntax
|
||||||
@@ -1496,12 +1496,10 @@ static void ins_redraw(bool ready)
|
|||||||
if (syntax_present(curwin) && must_redraw) {
|
if (syntax_present(curwin) && must_redraw) {
|
||||||
update_screen(0);
|
update_screen(0);
|
||||||
}
|
}
|
||||||
if (has_event(EVENT_CURSORMOVEDI)) {
|
// Make sure curswant is correct, an autocommand may call
|
||||||
// Make sure curswant is correct, an autocommand may call
|
// getcurpos()
|
||||||
// getcurpos()
|
update_curswant();
|
||||||
update_curswant();
|
ins_apply_autocmds(EVENT_CURSORMOVEDI);
|
||||||
ins_apply_autocmds(EVENT_CURSORMOVEDI);
|
|
||||||
}
|
|
||||||
curwin->w_last_cursormoved = curwin->w_cursor;
|
curwin->w_last_cursormoved = curwin->w_cursor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1233,12 +1233,9 @@ static void normal_check_window_scrolled(NormalState *s)
|
|||||||
static void normal_check_cursor_moved(NormalState *s)
|
static void normal_check_cursor_moved(NormalState *s)
|
||||||
{
|
{
|
||||||
// Trigger CursorMoved if the cursor moved.
|
// Trigger CursorMoved if the cursor moved.
|
||||||
if (!finish_op && (has_event(EVENT_CURSORMOVED) || curwin->w_p_cole > 0)
|
if (!finish_op && has_event(EVENT_CURSORMOVED)
|
||||||
&& !equalpos(curwin->w_last_cursormoved, curwin->w_cursor)) {
|
&& !equalpos(curwin->w_last_cursormoved, curwin->w_cursor)) {
|
||||||
if (has_event(EVENT_CURSORMOVED)) {
|
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, false, curbuf);
|
||||||
apply_autocmds(EVENT_CURSORMOVED, NULL, NULL, false, curbuf);
|
|
||||||
}
|
|
||||||
|
|
||||||
curwin->w_last_cursormoved = curwin->w_cursor;
|
curwin->w_last_cursormoved = curwin->w_cursor;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user