Skip to content

Commit 61dcc10

Browse files
committed
Move tpipeline_split read next to left pipe read
This makes future refactoring easier.
1 parent 1b87824 commit 61dcc10

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

autoload/tpipeline.vim

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,9 @@ func tpipeline#fork_job()
174174
let s:restore_right = systemlist("sh -c 'echo \"\"; tmux display-message -p \"#{status-right}\"'")[-1]
175175
endif
176176
let script = printf("export IFS='$\\n'; while read -r l; do echo \"$l\" > '%s'", s:tpipeline_filepath)
177+
if g:tpipeline_split
178+
let script .= printf("; read -r r; echo \"$r\" > '%s'", s:tpipeline_right_filepath)
179+
endif
177180
if g:tpipeline_usepane
178181
" end early if file was truncated so as not to overwrite any titles of panes we may switch to
179182
let script .= "; if [ -z \"$l\" ]; then continue; fi"
@@ -189,9 +192,6 @@ func tpipeline#fork_job()
189192
let script .= "; tmux set status-style \"$C\""
190193
endif
191194
endif
192-
if g:tpipeline_split
193-
let script .= printf("; read -r r; echo \"$r\" > '%s'", s:tpipeline_right_filepath)
194-
endif
195195
if g:tpipeline_usepane
196196
let script .= "; tmux select-pane -T \"#[fill=${C:3}]#[align=left]$l#[align=right]$r\""
197197
endif

0 commit comments

Comments
 (0)