diff options
Diffstat (limited to 'Src/Zle')
-rw-r--r-- | Src/Zle/zle_main.c | 5 | ||||
-rw-r--r-- | Src/Zle/zle_vi.c | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Src/Zle/zle_main.c b/Src/Zle/zle_main.c index 8344c66be..d157e36c2 100644 --- a/Src/Zle/zle_main.c +++ b/Src/Zle/zle_main.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) { diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c index 68b1c9211..a7e8a70cc 100644 --- a/Src/Zle/zle_vi.c +++ b/Src/Zle/zle_vi.c @@ -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 * |