From 4b8d843c55c9e12418cef3498e84b2da67b53f1d Mon Sep 17 00:00:00 2001 From: Thiago Talma Date: Fri, 11 Nov 2016 18:17:09 -0200 Subject: [PATCH] Check if can bind Prevent this error: ``` /home/vagrant/.marker/bin/marker.sh: line 164: bind: warning: line editing not enabled ``` --- bin/marker.sh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/bin/marker.sh b/bin/marker.sh index 5c49a79..acaaa05 100644 --- a/bin/marker.sh +++ b/bin/marker.sh @@ -160,13 +160,15 @@ elif [[ -n "$BASH" ]]; then READLINE_POINT="${#READLINE_LINE}" } - # bind -x somehow doesn't support ctrl+space directly - bind -x '"\emg1":"_marker_get"' - bind '"'"$marker_key_get"'":"\emg1"' + if [[ $- =~ .*i.* ]]; then + # bind -x somehow doesn't support ctrl+space directly + bind -x '"\emg1":"_marker_get"' + bind '"'"$marker_key_get"'":"\emg1"' - bind -x '"\emm1":"_marker_mark_1"' - bind -x '"\emm2":"_marker_mark_2"' - bind '"'"$marker_key_mark"'":"\emm1\n\emm2"' + bind -x '"\emm1":"_marker_mark_1"' + bind -x '"\emm2":"_marker_mark_2"' + bind '"'"$marker_key_mark"'":"\emm1\n\emm2"' - bind -x '"'"$marker_key_next_placeholder"'":"_move_cursor_to_next_placeholder"' + bind -x '"'"$marker_key_next_placeholder"'":"_move_cursor_to_next_placeholder"' + fi fi