aboutsummaryrefslogtreecommitdiffstats
path: root/incdec
diff options
context:
space:
mode:
Diffstat (limited to 'incdec')
-rw-r--r--incdec12
1 files changed, 8 insertions, 4 deletions
diff --git a/incdec b/incdec
index 854717d..3320bad 100644
--- a/incdec
+++ b/incdec
@@ -8,9 +8,9 @@ function incdec {
local number=
# If the line part doesn't contain a number, exit.
- if ! [[ "$line_part" =~ [^0-9]*([0-9]+)[^0-9]* ]]; then
- return $EX_DATAERR
- fi
+ # if ! [[ "$line_part" =~ [^0-9]*([0-9]+)[^0-9]* ]]; then
+ # return $EX_DATAERR
+ # fi
number=${BASH_REMATCH[1]}
@@ -20,7 +20,9 @@ function incdec {
incremented_line="$(echo "$line_part" | perl -pe 's/(\d+)/$1+1/e')"
- printf "${READLINE_LINE:0:$READLINE_POINT}$incremented_line"
+ # echo "${READLINE_LINE:0:$READLINE_POINT}$incremented_line"
+ READLINE_LINE="${READLINE_LINE:0:$READLINE_POINT}$incremented_line"
+ # echo 'this is a test'
}
function __readline_incdec_incdec2 {
@@ -33,6 +35,8 @@ function __readline_incdec_incdec2 {
# }
bind -x '"\C-xa+":incdec'
+# bind '"\C-xa+": "\C-e$(incdec)\e\C-e"'
+# bind '"\C-xa+": "\C-e`incdec`"'
# bind '"\C-xaa":\C-xa+'
function __readline_incdec_save_readline_point {