forked from nvimdev/lspsaga.nvim
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(nvimdev#1482): adds the ability to set a prefix to winbar
- Loading branch information
1 parent
4ce44df
commit e55e661
Showing
3 changed files
with
38 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
require('lspsaga').setup({}) | ||
local api = vim.api | ||
|
||
describe('winbar', function() | ||
before_each(function() | ||
local buf = api.nvim_create_buf(false, true) | ||
api.nvim_set_current_buf(buf) | ||
api.nvim_command('vsplit') | ||
api.nvim_set_current_win(api.nvim_get_current_win()) | ||
end) | ||
|
||
it('should handle width limitation in winbar', function() | ||
-- Inicialize o winbar | ||
require('lspsaga.symbol.winbar').init_winbar(api.nvim_get_current_buf()) | ||
|
||
-- Simula uma situação onde há muitos itens na winbar | ||
-- (Adapte conforme necessário para criar uma lista longa de símbolos) | ||
api.nvim_set_option_value('winbar', string.rep('Item|', 50), { | ||
scope = 'local', | ||
win = api.nvim_get_current_win(), | ||
}) | ||
|
||
-- Verifique se o winbar lida com a largura da janela corretamente | ||
local winbar_value = | ||
api.nvim_get_option_value('winbar', { scope = 'local', win = api.nvim_get_current_win() }) | ||
assert(winbar_value:match('...'), 'Winbar does not handle width limitation correctly') | ||
end) | ||
end) |