diff options
Diffstat (limited to 'Src')
-rw-r--r-- | Src/Zle/zle_vi.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/Src/Zle/zle_vi.c b/Src/Zle/zle_vi.c index 20cece0a8..53919e361 100644 --- a/Src/Zle/zle_vi.c +++ b/Src/Zle/zle_vi.c @@ -457,7 +457,14 @@ viyank(UNUSED(char **args)) ret = 0; } vichgflag = 0; - zlecs = oldcs; + /* cursor now at the start of the range yanked. For line mode + * restore the column position */ + if (vilinerange) { + while (oldcs > 0 && zleline[oldcs - 1] != ZWC('\n') && + zlecs != zlell && zleline[zlecs] != ZWC('\n')) { + ++zlecs; --oldcs; + } + } return ret; } |