Try to fix bug with hidden terminal buffers
This commit is contained in:
parent
0c33486857
commit
7cd72735f2
@ -33,11 +33,13 @@
|
|||||||
(var last_id 0)
|
(var last_id 0)
|
||||||
(var terms [ ])
|
(var terms [ ])
|
||||||
(each [_ id (pairs (vim.api.nvim_list_bufs))]
|
(each [_ id (pairs (vim.api.nvim_list_bufs))]
|
||||||
(let [name (vim.api.nvim_buf_get_name id)]
|
(when (and (vim.api.nvim_buf_is_loaded id)
|
||||||
(when (vim.startswith name "term://")
|
(vim.api.nvim_buf_get_option id :buflisted))
|
||||||
(table.insert terms name)
|
(let [name (vim.api.nvim_buf_get_name id)]
|
||||||
(set term_count (+ term_count 1))
|
(when (vim.startswith name "term://")
|
||||||
(set last_id id))))
|
(table.insert terms name)
|
||||||
|
(set term_count (+ term_count 1))
|
||||||
|
(set last_id id)))))
|
||||||
(if (= term_count 0)
|
(if (= term_count 0)
|
||||||
(vim.cmd.terminal)
|
(vim.cmd.terminal)
|
||||||
(= term_count 1)
|
(= term_count 1)
|
||||||
|
Reference in New Issue
Block a user