1
0
forked from aniani/vim

patch 9.1.0683: mode() returns wrong value with <Cmd> mapping

Problem:  mode() returns wrong value with <Cmd> mapping
Solution: Change decision priority of VIsual_active and move
          visual mode a bit further down (kuuote)

closes: #15533

Signed-off-by: kuuote <znmxodq1@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
kuuote
2024-08-20 19:53:17 +02:00
committed by Christian Brabandt
parent 3840d2feaf
commit 0fd1cb1b1f
3 changed files with 17 additions and 11 deletions

View File

@@ -678,17 +678,6 @@ get_mode(char_u *buf)
buf[i++] = 't';
}
#endif
else if (VIsual_active)
{
if (VIsual_select)
buf[i++] = VIsual_mode + 's' - 'v';
else
{
buf[i++] = VIsual_mode;
if (restart_VIsual_select)
buf[i++] = 's';
}
}
else if (State == MODE_HITRETURN || State == MODE_ASKMORE
|| State == MODE_SETWSIZE
|| State == MODE_CONFIRM)
@@ -731,6 +720,17 @@ get_mode(char_u *buf)
if ((State & MODE_CMDLINE) && cmdline_overstrike())
buf[i++] = 'r';
}
else if (VIsual_active)
{
if (VIsual_select)
buf[i++] = VIsual_mode + 's' - 'v';
else
{
buf[i++] = VIsual_mode;
if (restart_VIsual_select)
buf[i++] = 's';
}
}
else
{
buf[i++] = 'n';