Skip to content

Commit

Permalink
patch 8.2.4636: not using Visual range
Browse files Browse the repository at this point in the history
Problem:    Not using Visual range.
Solution:   Put the command pointer back to the range.
  • Loading branch information
brammool committed Mar 27, 2022
1 parent 501f978 commit 1501b63
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
24 changes: 15 additions & 9 deletions src/ex_docmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3092,15 +3092,21 @@ parse_command_modifiers(
break;
}

if (has_visual_range && eap->cmd > cmd_start)
{
// Move the '<,'> range to after the modifiers and insert a colon.
// Since the modifiers have been parsed put the colon on top of the
// space: "'<,'>mod cmd" -> "mod:'<,'>cmd
// Put eap->cmd after the colon.
mch_memmove(cmd_start - 5, cmd_start, eap->cmd - cmd_start);
eap->cmd -= 5;
mch_memmove(eap->cmd - 1, ":'<,'>", 6);
if (has_visual_range)
{
if (eap->cmd > cmd_start)
{
// Move the '<,'> range to after the modifiers and insert a colon.
// Since the modifiers have been parsed put the colon on top of the
// space: "'<,'>mod cmd" -> "mod:'<,'>cmd
// Put eap->cmd after the colon.
mch_memmove(cmd_start - 5, cmd_start, eap->cmd - cmd_start);
eap->cmd -= 5;
mch_memmove(eap->cmd - 1, ":'<,'>", 6);
}
else
// no modifiers, move the pointer back
eap->cmd -= 5;
}

return OK;
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Original file line number Diff line number Diff line change
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
4636,
/**/
4635,
/**/
Expand Down

0 comments on commit 1501b63

Please sign in to comment.