diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-14 14:57:52 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-14 14:57:52 +0000 |
commit | fe6d34f024a20d57741b500a91649fa7032cc509 (patch) | |
tree | 110b2ad2612ede550834b973a9287c454c604904 | |
parent | 5eb7948f86c518a489be3f4150c6cf588fd58727 (diff) | |
download | zsh-fe6d34f024a20d57741b500a91649fa7032cc509.tar.gz zsh-fe6d34f024a20d57741b500a91649fa7032cc509.tar.xz zsh-fe6d34f024a20d57741b500a91649fa7032cc509.zip |
24816: some places where we need cursor alignment with combining characters
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | Src/Zle/zle_hist.c | 6 | ||||
-rw-r--r-- | Src/Zle/zle_misc.c | 2 | ||||
-rw-r--r-- | Src/Zle/zle_tricky.c | 5 |
4 files changed, 12 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog index b4c1eace9..c71744d5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-04-14 Peter Stephenson <pws@csr.com> + * 24816: Src/Zle/zle_hist.c, Src/Zle/zle_misc.c, + Src/Zle/zle_tricky.c: a few places where we need to alight + with combining characters. + * 24814: Src/hist.c: suspicious handling of temporary history buffer. diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c index ddd17b760..066750e23 100644 --- a/Src/Zle/zle_hist.c +++ b/Src/Zle/zle_hist.c @@ -756,10 +756,12 @@ zle_setline(Histent he) ZS_memcpy(zleline, he->zle_text, zlell); if ((zlecs = zlell) && invicmdmode()) - zlecs--; + DECCS(); } else { setline(he->node.nam, ZSL_COPY|ZSL_TOEND); } + /* Move right if we're on a zero-width combining character */ + CCRIGHT(); setlastline(); clearlist = 1; } @@ -1548,6 +1550,7 @@ historybeginningsearchbackward(char **args) zletextfree(&zt); zle_setline(he); zlecs = cpos; + CCRIGHT(); return 0; } } @@ -1588,6 +1591,7 @@ historybeginningsearchforward(char **args) zletextfree(&zt); zle_setline(he); zlecs = cpos; + CCRIGHT(); return 0; } } diff --git a/Src/Zle/zle_misc.c b/Src/Zle/zle_misc.c index fb8070e0a..fb03ee149 100644 --- a/Src/Zle/zle_misc.c +++ b/Src/Zle/zle_misc.c @@ -56,6 +56,8 @@ doinsert(ZLE_STRING_T zstr, int len) zleline[zlecs++] = *s; if(neg) zlecs += zmult * len; + /* if we ended up on a combining character, skip over it */ + CCRIGHT(); } /**/ diff --git a/Src/Zle/zle_tricky.c b/Src/Zle/zle_tricky.c index 8223c7046..d7c17676b 100644 --- a/Src/Zle/zle_tricky.c +++ b/Src/Zle/zle_tricky.c @@ -980,14 +980,11 @@ unmetafy_line(void) free(zlemetaline); zlemetaline = NULL; - -#ifdef MULTIBYTE_SUPPORT /* * If we inserted combining characters under the cursor we * won't have tested the effect yet. So fix it up now. */ - alignmultiwordright(1); -#endif + CCRIGHT(); } /* Free a brinfo list. */ |