File tree Expand file tree Collapse file tree 4 files changed +43
-10
lines changed Expand file tree Collapse file tree 4 files changed +43
-10
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ winbar:
217
217
- Default :
218
218
` ` ` lua
219
219
{
220
- ' OptionSet ' ,
220
+ ' TermOpen ' ,
221
221
' BufWinEnter' ,
222
222
' BufWritePost' ,
223
223
}
@@ -1291,9 +1291,8 @@ require('dropbar').setup({
1291
1291
return false
1292
1292
end
1293
1293
1294
- return vim .bo [buf ].ft == ' markdown'
1295
- or vim .bo [buf ].ft == ' oil' -- enable in oil buffers
1296
- or vim .bo [buf ].ft == ' fugitive' -- enable in fugitive buffers
1294
+ return vim .bo [buf ].bt == ' terminal'
1295
+ or vim .bo [buf ].ft == ' markdown'
1297
1296
or pcall (vim .treesitter .get_parser , buf )
1298
1297
or not vim .tbl_isempty (vim .lsp .get_clients ({
1299
1298
bufnr = buf ,
Original file line number Diff line number Diff line change 1
- *dropbar.txt* Last change: 2025 May 23
1
+ *dropbar.txt* Last change: 2025 June 10
2
2
3
3
==============================================================================
4
4
INTRODUCTION *dropbar-introduction*
@@ -210,7 +210,7 @@ the winbar:
210
210
- Default:
211
211
>lua
212
212
{
213
- 'OptionSet ',
213
+ 'TermOpen ',
214
214
'BufWinEnter',
215
215
'BufWritePost',
216
216
}
@@ -1226,9 +1226,8 @@ This configuration should addresses the issue:
1226
1226
return false
1227
1227
end
1228
1228
1229
- return vim.bo[buf].ft == 'markdown'
1230
- or vim.bo[buf].ft == 'oil' -- enable in oil buffers
1231
- or vim.bo[buf].ft == 'fugitive' -- enable in fugitive buffers
1229
+ return vim.bo[buf].bt == 'terminal'
1230
+ or vim.bo[buf].ft == 'markdown'
1232
1231
or pcall(vim.treesitter.get_parser, buf)
1233
1232
or not vim.tbl_isempty(vim.lsp.get_clients({
1234
1233
bufnr = buf,
Original file line number Diff line number Diff line change @@ -278,14 +278,16 @@ M.opts = {
278
278
return false
279
279
end
280
280
281
- return vim .bo [buf ].ft == ' markdown'
281
+ return vim .bo [buf ].bt == ' terminal'
282
+ or vim .bo [buf ].ft == ' markdown'
282
283
or pcall (vim .treesitter .get_parser , buf )
283
284
or not vim .tbl_isempty (vim .lsp .get_clients ({
284
285
bufnr = buf ,
285
286
method = ' textDocument/documentSymbol' ,
286
287
}))
287
288
end ,
288
289
attach_events = {
290
+ ' TermOpen' ,
289
291
' BufWinEnter' ,
290
292
' BufWritePost' ,
291
293
},
Original file line number Diff line number Diff line change
1
+ local dropbar = require (' dropbar' )
2
+ local configs = require (' dropbar.configs' )
3
+
4
+ describe (' [terminal]' , function ()
5
+ local term_buf = nil
6
+ local term_win = nil
7
+
8
+ before_each (function ()
9
+ vim .cmd .terminal ()
10
+ term_buf = vim .api .nvim_get_current_buf ()
11
+ term_win = vim .api .nvim_get_current_win ()
12
+ -- Wait for terminal to be ready and dropbar to attach
13
+ vim .wait (100 )
14
+ end )
15
+
16
+ after_each (function ()
17
+ -- Clean up terminal buffer
18
+ if vim .api .nvim_buf_is_valid (term_buf ) then
19
+ vim .api .nvim_buf_delete (term_buf , { force = true })
20
+ end
21
+ end )
22
+
23
+ it (' attaches dropbar to terminal buffers' , function ()
24
+ assert .are .equal (' terminal' , vim .bo [term_buf ].bt )
25
+
26
+ assert .is_not_nil (_G .dropbar .bars [term_buf ])
27
+ assert .is_not_nil (_G .dropbar .bars [term_buf ][term_win ])
28
+
29
+ local winbar = _G .dropbar .bars [term_buf ][term_win ]
30
+ assert .is_not_nil (winbar )
31
+ assert .is_table (winbar .components )
32
+ end )
33
+ end )
You can’t perform that action at this time.
0 commit comments