summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Kiddle <opk@zsh.org>2016-06-22 22:15:52 +0200
committerOliver Kiddle <opk@zsh.org>2016-06-22 22:15:52 +0200
commit76f28cc908b8c7ce72bc54496c5af74f6ca29c63 (patch)
tree2df3eb395237b64cf588b0becea6890bcda18169
parent7ae2deb4378d50d81774e73c2574375a0f934797 (diff)
downloadzsh-76f28cc908b8c7ce72bc54496c5af74f6ca29c63.tar.gz
zsh-76f28cc908b8c7ce72bc54496c5af74f6ca29c63.zip
38749: fixes for case at start of a line and for ksharrays
-rw-r--r--ChangeLog5
-rw-r--r--Functions/Zle/select-bracketed2
-rw-r--r--Functions/Zle/surround6
3 files changed, 12 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index a3b91cf4b..b2a8ee585 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-06-22 Oliver Kiddle <opk@zsh.org>
+
+ * 38749: Functions/Zle/surround, Functions/Zle/select-bracketed:
+ fixes for case at start of a line and for ksharrays
+
2016-06-22 Peter Stephenson <p.stephenson@samsung.com>
* unposted: Src/lex.c: remove unused and no longer defined flag
diff --git a/Functions/Zle/select-bracketed b/Functions/Zle/select-bracketed
index 00f51be2c..d467bb804 100644
--- a/Functions/Zle/select-bracketed
+++ b/Functions/Zle/select-bracketed
@@ -12,6 +12,8 @@
# done
# done
+setopt localoptions noksharrays
+
local style=${${1:-$KEYS}[1]} matching="(){}[]<>bbBB"
local -i find=${NUMERIC:-1} idx=${matching[(I)[${${1:-$KEYS}[2]}]]}%9
(( idx )) || return 1 # no corresponding closing bracket
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