Skip to content

Commit d9754f9

Browse files
authored
Merge pull request #249 from JS-Zheng/master
fix: tab page restoration when `focus=0` & `reuse=1`
2 parents 9f8e500 + dc5f4a1 commit d9754f9

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

plugin/asyncrun.vim

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1481,10 +1481,10 @@ function! s:start_in_terminal(opts)
14811481
if hr >= 0
14821482
if focus == 0
14831483
exec has('nvim')? 'stopinsert' : ''
1484-
if pos ==# 'TAB'
1485-
exec 'tabnext'
1486-
else
1487-
exec 'tabprevious'
1484+
let last_tid = tabpagenr('#')
1485+
if last_tid > 0
1486+
" Go to the last accessed tab page.
1487+
exec 'tabnext' last_tid
14881488
endif
14891489
endif
14901490
endif

0 commit comments

Comments
 (0)