diff options
author | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-20 21:17:29 +0000 |
---|---|---|
committer | Peter Stephenson <pws@users.sourceforge.net> | 2008-04-20 21:17:29 +0000 |
commit | b8ec06c870ac09d5949907640dca4c1a2b711ed5 (patch) | |
tree | f5676d7f945f34fe69e30e67fa7fbc8a82730b94 /Src/Zle/zle.h | |
parent | a12b1f35aaeff5724c1d7b4824de62cb4e480698 (diff) | |
download | zsh-b8ec06c870ac09d5949907640dca4c1a2b711ed5.tar.gz zsh-b8ec06c870ac09d5949907640dca4c1a2b711ed5.tar.xz zsh-b8ec06c870ac09d5949907640dca4c1a2b711ed5.zip |
24853: use metafied strings for inner loops over history
Diffstat (limited to 'Src/Zle/zle.h')
-rw-r--r-- | Src/Zle/zle.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/Src/Zle/zle.h b/Src/Zle/zle.h index bed5888cb..a91d84400 100644 --- a/Src/Zle/zle.h +++ b/Src/Zle/zle.h @@ -74,10 +74,22 @@ typedef wint_t ZLE_INT_T; #define LASTFULLCHAR lastchar_wide #define LASTFULLCHAR_T ZLE_INT_T -/* We may need to handle combining character alignment */ +/* + * We may need to handle combining character alignment. + * The following fix up the position of the cursor so that it + * never ends up over a zero-width punctuation character following + * an alphanumeric character. The first is used if we were + * moving the cursor left, the second if we were moving right or + * if something under the cursor may have changed. + */ #define CCLEFT() alignmultiwordleft(&zlecs, 1) #define CCRIGHT() alignmultiwordright(&zlecs, 1) /* + * Same for any other position + */ +#define CCLEFTPOS(pos) alignmultiwordleft(&pos, 1) +#define CCRIGHTPOS(pos) alignmultiwordright(&pos, 1) +/* * Increment or decrement the cursor position, skipping over * combining characters. */ @@ -151,6 +163,8 @@ static inline int ZS_strncmp(ZLE_STRING_T s1, ZLE_STRING_T s2, size_t l) /* Combining character alignment: none in this mode */ #define CCLEFT() #define CCRIGHT() +#define CCLEFTPOS() +#define CCRIGHTPOS() /* * Increment or decrement the cursor position: simple in this case. */ @@ -235,7 +249,13 @@ struct modifier { #define CUT_FRONT (1<<0) /* Text goes in front of cut buffer */ #define CUT_REPLACE (1<<1) /* Text replaces cut buffer */ -#define CUT_RAW (1<<2) /* Raw character counts (not used in cut itself) */ +#define CUT_RAW (1<<2) /* + * Raw character counts (not used in cut itself). + * This is used when the values are offsets + * into the zleline array rather than numbers + * of visible characters directly input by + * the user. + */ /* undo system */ |