1
0
mirror of git://git.code.sf.net/p/zsh/code synced 2024-11-15 13:34:18 +01:00

33632: use viopp and visual local keymaps if they exist

This commit is contained in:
Oliver Kiddle 2014-11-17 00:41:12 +01:00
parent 1e934556f7
commit 15fc2cd4f0
3 changed files with 14 additions and 1 deletions

@ -1,3 +1,8 @@
2014-11-16 Oliver Kiddle <opk@zsh.org>
* 33632: Src/Zle/zle_main.c, Src/Zle/zle_vi.c: use viopp and visual
local keymaps if they exist
2014-11-15 Oliver Kiddle <opk@zsh.org>
* 33697: Doc/Zsh/zle.yo, Src/Zle/iwidgets.list, Src/Zle/zle_word.c:

@ -1067,6 +1067,7 @@ getrestchar(int inchar)
void
zlecore(void)
{
Keymap km;
#if !defined(HAVE_POLL) && defined(HAVE_SELECT)
struct timeval tv;
fd_set foofd;
@ -1088,8 +1089,10 @@ zlecore(void)
statusline = NULL;
vilinerange = 0;
reselectkeymap();
selectlocalmap(NULL);
selectlocalmap(invicmdmode() && region_active && (km = openkeymap("visual"))
? km : NULL);
bindk = getkeycmd();
selectlocalmap(NULL);
if (bindk) {
if (!zlell && isfirstln && !(zlereadflags & ZLRF_IGNOREEOF) &&
lastchar == eofchar) {

@ -167,6 +167,10 @@ getvirange(int wf)
virangeflag = 1;
wordflag = wf;
/* use operator-pending keymap if one exists */
Keymap km = openkeymap("viopp");
if (km)
selectlocalmap(km);
/* Now we need to execute the movement command, to see where it *
* actually goes. virangeflag here indicates to the movement *
* function that it should place the cursor at the end of the *
@ -224,6 +228,7 @@ getvirange(int wf)
if (virangeflag == -1)
INCPOS(pos);
virangeflag = 0;
selectlocalmap(NULL);
/* Get the range the right way round. zlecs is placed at the *
* start of the range, and pos (the return value of this *