1 parent c4233de commit 9cb1a6aCopy full SHA for 9cb1a6a
1 file changed
functions/_pisces_backspace.fish
@@ -1,8 +1,16 @@
1
function _pisces_backspace -d "Overrides backspace to handle empty pairs removal"
2
3
- for pair in $pisces_pairs
4
- _pisces_remove (string split -- ',' $pair)
5
- and return 0
+ set -l line (commandline | string join \n)
+ set -l index (commandline -C)
+ if [ $index -ge 1 ]
6
+ set -l char (string sub -s $index -l 1 "$line")
7
+ for pair in $pisces_pairs
8
+ set -l var (string split -- ',' $pair)
9
+ if [ $var[1] = $char ]
10
+ _pisces_remove $var
11
+ and return 0
12
+ end
13
14
end
15
16
commandline -f backward-delete-char
0 commit comments