mirror of
https://github.com/neovim/neovim.git
synced 2024-12-24 05:05:00 -07:00
fix(normal): don't check conceal when pressing 'r' (#27892)
Problem: Cursor line is unconcealed when pressing 'r' in Normal mode when 'concealcursor' contains 'n' but not 'i'. Solution: Don't check conceal when pressing 'r' in Normal mode. Vim doesn't have this problem because it doesn't call redrawWinline() in conceal_check_cursor_line() and instead sets a global variable.
This commit is contained in:
parent
d114dbe9f7
commit
c52dfb6e84
@ -748,7 +748,7 @@ static void normal_get_additional_char(NormalState *s)
|
|||||||
bool langmap_active = false; // using :lmap mappings
|
bool langmap_active = false; // using :lmap mappings
|
||||||
if (repl) {
|
if (repl) {
|
||||||
State = MODE_REPLACE; // pretend Replace mode
|
State = MODE_REPLACE; // pretend Replace mode
|
||||||
ui_cursor_shape(); // show different cursor shape
|
ui_cursor_shape_no_check_conceal(); // show different cursor shape
|
||||||
}
|
}
|
||||||
if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP) {
|
if (lang && curbuf->b_p_iminsert == B_IMODE_LMAP) {
|
||||||
// Allow mappings defined with ":lmap".
|
// Allow mappings defined with ":lmap".
|
||||||
|
@ -624,7 +624,7 @@ void ui_check_mouse(void)
|
|||||||
/// Check if current mode has changed.
|
/// Check if current mode has changed.
|
||||||
///
|
///
|
||||||
/// May update the shape of the cursor.
|
/// May update the shape of the cursor.
|
||||||
void ui_cursor_shape(void)
|
void ui_cursor_shape_no_check_conceal(void)
|
||||||
{
|
{
|
||||||
if (!full_screen) {
|
if (!full_screen) {
|
||||||
return;
|
return;
|
||||||
@ -635,6 +635,15 @@ void ui_cursor_shape(void)
|
|||||||
ui_mode_idx = new_mode_idx;
|
ui_mode_idx = new_mode_idx;
|
||||||
pending_mode_update = true;
|
pending_mode_update = true;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Check if current mode has changed.
|
||||||
|
///
|
||||||
|
/// May update the shape of the cursor.
|
||||||
|
/// With concealing on, may conceal or unconceal the cursor line.
|
||||||
|
void ui_cursor_shape(void)
|
||||||
|
{
|
||||||
|
ui_cursor_shape_no_check_conceal();
|
||||||
conceal_check_cursor_line();
|
conceal_check_cursor_line();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -435,6 +435,18 @@ describe('Screen', function()
|
|||||||
{0:~ }|*3
|
{0:~ }|*3
|
||||||
|
|
|
|
||||||
]])
|
]])
|
||||||
|
|
||||||
|
feed('r')
|
||||||
|
screen:expect_unchanged()
|
||||||
|
|
||||||
|
feed('m')
|
||||||
|
screen:expect([[
|
||||||
|
^moo {1:b} bar {1:b} eggs |
|
||||||
|
foo {1:b} bar {1:b} eggs |*4
|
||||||
|
|
|
||||||
|
{0:~ }|*3
|
||||||
|
|
|
||||||
|
]])
|
||||||
end)
|
end)
|
||||||
|
|
||||||
it('and open line', function()
|
it('and open line', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user