feat: added extension for trouble (#932)

* added extension for trouble

* add trouble extension to readme
This commit is contained in:
Matthew Sia 2023-03-30 02:21:11 -04:00 committed by GitHub
parent 3256691f8e
commit 7600962455
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 23 additions and 0 deletions

View File

@ -899,6 +899,7 @@ extensions = {'quickfix'}
- quickfix - quickfix
- symbols-outline - symbols-outline
- toggleterm - toggleterm
- trouble
#### Custom extensions #### Custom extensions

View File

@ -0,0 +1,22 @@
local M = {}
local function get_trouble_mode()
local opts = require('trouble.config').options
local words = vim.split(opts.mode, '[%W]')
for i, word in ipairs(words) do
words[i] = word:sub(1, 1):upper() .. word:sub(2)
end
return table.concat(words, ' ')
end
M.sections = {
lualine_a = {
get_trouble_mode,
},
}
M.filetypes = { 'Trouble' }
return M