From 76f28cc908b8c7ce72bc54496c5af74f6ca29c63 Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Wed, 22 Jun 2016 22:15:52 +0200 Subject: 38749: fixes for case at start of a line and for ksharrays --- Functions/Zle/surround | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'Functions/Zle/surround') diff --git a/Functions/Zle/surround b/Functions/Zle/surround index b7be30b75..348ceecc2 100644 --- a/Functions/Zle/surround +++ b/Functions/Zle/surround @@ -69,7 +69,11 @@ case $WIDGET in before="${(k)matching[(r)[$before:q]]}" fi CUTBUFFER="$before$CUTBUFFER$after" - zle .vi-put-after -n 1 + if [[ CURSOR -eq 0 || $BUFFER[CURSOR] = $'\n' ]]; then + zle .vi-put-before -n 1 + else + zle .vi-put-after -n 1 + fi CUTBUFFER="$save_cut" CURSOR="$save_cur" ;; esac -- cgit v1.2.3 From 5dc7b35ff6edbecad8ee077de44d880eb7907a6f Mon Sep 17 00:00:00 2001 From: Oliver Kiddle Date: Fri, 25 Nov 2016 23:07:46 +0100 Subject: unposted: set new vichange flag for surround widget --- ChangeLog | 2 ++ Functions/Zle/surround | 1 + 2 files changed, 3 insertions(+) (limited to 'Functions/Zle/surround') diff --git a/ChangeLog b/ChangeLog index 8ec718973..0c8e81776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2016-11-25 Oliver Kiddle + * unposted: Functions/Zle/surround: set new vichange flag + * 40020: Completion/Unix/Command/_cscope: new completion 2016-11-25 Laurent Arnoud diff --git a/Functions/Zle/surround b/Functions/Zle/surround index 348ceecc2..b51b77c04 100644 --- a/Functions/Zle/surround +++ b/Functions/Zle/surround @@ -19,6 +19,7 @@ local before after local -A matching matching=( \( \) \{ \} \< \> \[ \] ) +zle -f vichange case $WIDGET in change-*) local MARK="$MARK" CURSOR="$CURSOR" call -- cgit v1.2.3