diff options
author | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-08 19:38:46 +0000 |
---|---|---|
committer | Tanaka Akira <akr@users.sourceforge.net> | 1999-11-08 19:38:46 +0000 |
commit | dd00cca82ef4a43c54edb0e14b6bc9dba3fbff46 (patch) | |
tree | 317f7275b387a44708e68352e07091cfe0e17709 /Src/Zle/zle_utils.c | |
parent | 9873dda3aaaaea7c7b00c2c7c8e5b71123c91035 (diff) | |
download | zsh-dd00cca82ef4a43c54edb0e14b6bc9dba3fbff46.tar.gz zsh-dd00cca82ef4a43c54edb0e14b6bc9dba3fbff46.tar.xz zsh-dd00cca82ef4a43c54edb0e14b6bc9dba3fbff46.zip |
zsh-workers/8590
Diffstat (limited to 'Src/Zle/zle_utils.c')
-rw-r--r-- | Src/Zle/zle_utils.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/Src/Zle/zle_utils.c b/Src/Zle/zle_utils.c index bd2f39a06..2cd985124 100644 --- a/Src/Zle/zle_utils.c +++ b/Src/Zle/zle_utils.c @@ -53,7 +53,7 @@ struct cutbuffer vibuf[35]; /**/ char *lastline; /**/ -int lastlinesz, lastll; +int lastlinesz, lastll, lastcs; /* size of line buffer */ @@ -438,6 +438,7 @@ initundo(void) curchange->del = curchange->ins = NULL; lastline = zalloc(lastlinesz = linesz); memcpy(lastline, line, lastll = ll); + lastcs = cs; } /**/ @@ -511,6 +512,8 @@ mkundoent(void) ch->next = NULL; ch->hist = histline; ch->off = pre; + ch->old_cs = lastcs; + ch->new_cs = cs; if(suf + pre == lastll) ch->del = NULL; else @@ -541,6 +544,7 @@ setlastline(void) if(lastlinesz != linesz) lastline = realloc(lastline, lastlinesz = linesz); memcpy(lastline, line, lastll = ll); + lastcs = cs; } /* move backwards through the change list */ @@ -578,6 +582,7 @@ unapplychange(struct change *ch) else line[cs++] = STOUC(*c); } + cs = ch->old_cs; } /* move forwards through the change list */ @@ -616,6 +621,7 @@ applychange(struct change *ch) else line[cs++] = STOUC(*c); } + cs = ch->new_cs; } /* vi undo: toggle between the end of the undo list and the preceding point */ |