about summary refs log tree commit diff
diff options
context:
space:
mode:
authorZach DeCook <zachdecook@librem.one>2022-05-16 23:47:21 -0400
committerZach DeCook <zachdecook@librem.one>2022-05-16 23:47:21 -0400
commit88dbe5d4d781a67c7de6732c56fa86ac22ac8c57 (patch)
treed5c74623ba9c95fe41edc69f6f47b1066737a7e5
parent69ab83ab05443c11ca6633cd3ffba088602f5a98 (diff)
downloadSwipeBehaviors-88dbe5d4d781a67c7de6732c56fa86ac22ac8c57.tar.gz
predictor: backspace lastword
-rwxr-xr-xpredictor.sh3
1 files changed, 2 insertions, 1 deletions
diff --git a/predictor.sh b/predictor.sh
index 0ce7b44..ccbb21f 100755
--- a/predictor.sh
+++ b/predictor.sh
@@ -42,7 +42,8 @@ while read -r swipe; do
 				rm -f "$lw"
 			fi
 		elif test "$swipe" = "$(echo -e "\x08")"; then
-			rm -f "$lw"
+			lastword="$(cat "$lw")"
+			printf %s "$lastword" | sed 's/.$//g' > "$lw"
 		elif test "$swipe" = "$(echo -e "\n")"; then
 			rm -f "$lw"
 		else