diff options
author | Oliver Kiddle <okiddle@yahoo.co.uk> | 2014-02-05 21:55:18 +0100 |
---|---|---|
committer | Oliver Kiddle <okiddle@yahoo.co.uk> | 2014-02-05 21:55:18 +0100 |
commit | e1bc9d0a44da9c27c5558767cdb75da1a3424a4b (patch) | |
tree | 8242fb1af26e2423082813deea64383fcd869544 /Src/Zle/zle_vi.c | |
parent | 2cd3b9ab74a961798362d27094a6d29d7723c171 (diff) | |
download | zsh-e1bc9d0a44da9c27c5558767cdb75da1a3424a4b.tar.gz zsh-e1bc9d0a44da9c27c5558767cdb75da1a3424a4b.tar.xz zsh-e1bc9d0a44da9c27c5558767cdb75da1a3424a4b.zip |
32342: fix overstrike for vi mode and use varying vi commands at line start
Diffstat (limited to 'Src/Zle/zle_vi.c')
-rw-r--r-- | Src/Zle/zle_vi.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c index 79b8cb958..994b44fe3 100644 --- a/Src/Zle/zle_vi.c +++ b/Src/Zle/zle_vi.c @@ -79,8 +79,9 @@ static void startvichange(int im) { if (im != -1) { - insmode = im; vichgflag = 1; + if (im > -1) + insmode = im; } if (inrepeat && im != -2) { zmod = lastmod; @@ -92,7 +93,8 @@ startvichange(int im) free(vichgbuf); vichgbuf = (char *)zalloc(vichgbufsz = 16); if (im == -2) { - vichgbuf[0] = 'a'; + vichgbuf[0] = + zlell ? (insmode ? (zlecs < zlell ? 'i' : 'a') : 'R') : 'o'; } else { vichgbuf[0] = lastchar; } |