diff options
| -rw-r--r-- | src/buffer_utils.cc | 3 | ||||
| -rwxr-xr-x | test/run | 4 | ||||
| -rw-r--r-- | test/tools/git/blame-in-diff/rc | 15 | ||||
| -rw-r--r-- | test/tools/git/blame-in-diff/script | 11 |
4 files changed, 21 insertions, 12 deletions
diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index a2d2e709..bb64e9c1 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -290,7 +290,8 @@ Buffer* create_fifo_buffer(String name, int fd, Buffer::Flags flags, AutoScroll kak_assert(m_buffer.flags() & Buffer::Flags::Fifo); close_fd(); m_buffer.run_hook_in_own_context(Hook::BufCloseFifo, ""); - m_buffer.flags() &= ~(Buffer::Flags::Fifo | Buffer::Flags::NoUndo); + if (not m_buffer.values().contains(fifo_watcher_id)) + m_buffer.flags() &= ~(Buffer::Flags::Fifo | Buffer::Flags::NoUndo); } void read_fifo() @@ -204,11 +204,11 @@ ui_out() { [ "$event" = "$expected" ] && break done ;; - -until-eval | -until-grep) + -until-grep) pattern=$1 shift while read -r event <&4; do - if printf %s "$event" | "${arg#-until-}" "$pattern" >/dev/null; then + if printf %s "$event" | grep "$pattern" >/dev/null; then if [ $# -ne 0 ]; then assert_eq "$1" "$event" shift diff --git a/test/tools/git/blame-in-diff/rc b/test/tools/git/blame-in-diff/rc index eba02270..1fc54f3f 100644 --- a/test/tools/git/blame-in-diff/rc +++ b/test/tools/git/blame-in-diff/rc @@ -11,4 +11,19 @@ define-command run %{ git commit --all --message 'changed line 2' # Show the commit, jumping to the new version of line 2. git blame-jump + hook -once buffer BufCloseFifo .* %{ + evaluate-commands -client client0 %{ + # We've jumped to the new version of line 2. Move to the old + # version so we can annotate the old version of the file. + execute-keys k + git blame + hook -once buffer BufCloseFifo .* %{ + execute-keys -client client0 x + # Wait for a redraw before reporting completion. + hook -once buffer NormalIdle .* %{ + echo -to-file fifo + } + } + } + } } diff --git a/test/tools/git/blame-in-diff/script b/test/tools/git/blame-in-diff/script index 0cee0ca7..4c371348 100644 --- a/test/tools/git/blame-in-diff/script +++ b/test/tools/git/blame-in-diff/script @@ -1,10 +1,3 @@ -ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [false] }' - -# We've jumped to the new version of line 2. Move to the old version so we -# can annotate the old file. -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "k:git blame<ret>" ] }' -ui_out -until-eval 'grep "draw_status" | grep -v "\[fifo\]"' - +mkfifo fifo 2>/dev/null +cat fifo # We should have jumped to the old version of line 2, assert on kak_selection. -ui_in '{ "jsonrpc": "2.0", "method": "keys", "params": [ "x" ] }' -ui_out -until '{ "jsonrpc": "2.0", "method": "refresh", "params": [false] }' |
