Skip to content

Commit 4662923

Browse files
committed
fix: trouble extension. Works on Trouble.nvim v3.x
1 parent f4f791f commit 4662923

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lua/lualine/extensions/trouble.lua

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
local M = {}
22

33
local function get_trouble_mode()
4-
local opts = require('trouble.config').options
4+
local win = vim.api.nvim_get_current_win()
5+
local trouble = vim.w[win].trouble
6+
if trouble == nil or trouble.mode == nil then
7+
return ''
8+
end
59

6-
local words = vim.split(opts.mode, '[%W]')
10+
local words = vim.split(trouble.mode, '[%W]')
711
for i, word in ipairs(words) do
812
words[i] = word:sub(1, 1):upper() .. word:sub(2)
913
end
@@ -17,6 +21,6 @@ M.sections = {
1721
},
1822
}
1923

20-
M.filetypes = { 'Trouble' }
24+
M.filetypes = { 'trouble' }
2125

2226
return M

0 commit comments

Comments
 (0)