=== modified file 'kweasy-pane' --- kweasy-pane 2016-08-04 07:13:50 +0000 +++ kweasy-pane 2016-08-04 05:47:21 +0000 @@ -12,7 +12,7 @@ } test -n "$TMUX_PANE" || exit 2 if test -n "$1"; then - PANE="$1" + PANE=$1 else PANE=$(tmux list-panes -F '#{?pane_active,#D,}' | tr -d '\n\r ') fi @@ -21,9 +21,10 @@ die "This command needs to run in background pane ${TMUX_PANE//%/%%} | ${PANE//%/%}" fi # tmux display-message "kweasy-pane running: source=$PANE display=$TMUX_PANE" -if test -n "$FIND"; then +if test -n $FIND; then tmux capturep -b kweasy -t "$PANE" \; \ swap-pane -t "$PANE" + test -n "$DEBUG" && echo 'Ready!' && read else tmux capturep -b kweasy -t "$PANE" \; \ showb -b kweasy \; \ @@ -31,11 +32,7 @@ awk 'NR>1{print line} {line=$0} END{printf "%s", line}' FIND=$(tty-readbyte) fi -test -n "$DEBUG" && echo "Ready! »$FIND«" && read test -n "$FIND" || die-swap "nothing to match" -# Workaround for byte/character counting mismatch: |tr "$uni" "$asc"| -# uni='─━│┃┄┅┆┇┈┉┊┋┌┍┎┏┐┑┒┓└┕┖┗┘┙┚┛├┝┞┟┠┡┢┣┤┥┦┧┨┩┪┫┬┭┮┯┰┱┲┳┴┵┶┷┸┹┺┻┼┽┾┿╀╁╂╃╄╅╆╇╈╉╊╋╌╍╎╏═║╒╓╔╕╖╗╘╙╚╛╜╝╞╟╠╡╢╣╤╥╦╧╨╩╪╫╬╭╮╯╰╱╲╳╴╵╶╷╸╹╺╻╼╽╾╿▀▁▂▃▄▅▆▇█▉▊▋▌▍▎▏▐░▒▓▔▕▖▗▘▙▚▛▜▝▞▟' -# asc='\-\-||\-\-||\-\-||++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++\-\-||=|+++++++++++++++++++++++++++++++/\\X\-|\-|\-|\-|\-|\-|#____#######|||||###~###########' tmux saveb -b kweasy - | kweasy.awk FIND="$FIND" test -n "$DEBUG" && echo "Done! ($?)" && read tmux swap-pane -t $PANE === modified file 'kweasy.awk' --- kweasy.awk 2016-08-04 07:13:50 +0000 +++ kweasy.awk 2016-04-15 18:35:27 +0000 @@ -58,9 +58,7 @@ if(input in keys) { split(keys[input], i, SUBSEP) printf "%s+%s-%s:%s\n", i[1], i[2], i[3], lines[i[1]] - printf "%s\n%s\n", substr(lines[i[1]], 1, i[2]-1), substr(lines[i[1]], i[2]) | "plumb-click" - #system("sleep 5") - #printf "%s", lines[i[1]] | "plumb -a click=" i[2] " -i" + printf "%s", lines[i[1]] | "plumb -a click=" i[2] " -i" } else { printf "\nUnhandled input '%s'\n", input > "/dev/stderr" exit 1 === removed file 'plumb-click' --- plumb-click 2016-08-04 07:13:50 +0000 +++ plumb-click 1970-01-01 00:00:00 +0000 @@ -1,7 +0,0 @@ -#!/bin/sh -# Reads two lines: text up to cursor on one line and from the cursor -# (including) on the other. Then it computes byte-offsets (not character!) and -# passes it to plumb as single line with click attribute. -IFS= read -r lbuf -IFS= read -r rbuf -printf '%s' "$lbuf" "$rbuf" | plumb -a click=$(printf '%s' "$lbuf" |wc -c) "$@" -i