Skip to content

Commit

Permalink
fix: filetype set too early (#230)
Browse files Browse the repository at this point in the history
Filetype is set before width or height, which breaks changing the
window position inside autocommands from outside of the plugin. Move it
after setting the width/height.

Co-authored-by: ii14 <ii14@users.noreply.github.com>
  • Loading branch information
ii14 and ii14 committed Nov 16, 2022
1 parent ed65f84 commit c4da921
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lua/trouble/view.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,6 @@ function View:setup(opts)
self:set_option("foldenable", false, true)
self:set_option("winhighlight", "Normal:TroubleNormal,EndOfBuffer:TroubleNormal,SignColumn:TroubleNormal", true)
self:set_option("fcs", "eob: ", true)
self:set_option("filetype", "Trouble")

for action, keys in pairs(config.options.action_keys) do
if type(keys) == "string" then
Expand All @@ -171,6 +170,8 @@ function View:setup(opts)
vim.api.nvim_win_set_width(self.win, config.options.width)
end

self:set_option("filetype", "Trouble")

vim.api.nvim_exec(
[[
augroup TroubleHighlights
Expand Down

0 comments on commit c4da921

Please sign in to comment.