Skip to content

Commit 9cb1a6a

Browse files
nickeb96laughedelic
authored andcommitted
Removed delay between backspaces (#13)
1 parent c4233de commit 9cb1a6a

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

functions/_pisces_backspace.fish

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,16 @@
11
function _pisces_backspace -d "Overrides backspace to handle empty pairs removal"
22

3-
for pair in $pisces_pairs
4-
_pisces_remove (string split -- ',' $pair)
5-
and return 0
3+
set -l line (commandline | string join \n)
4+
set -l index (commandline -C)
5+
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+
end
614
end
715

816
commandline -f backward-delete-char

0 commit comments

Comments
 (0)