Skip to content

Commit e68f329

Browse files
committed
fix: define filetype after buffer setup
1 parent fc313ad commit e68f329

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lua/neogit/lib/buffer.lua

+5-5
Original file line numberDiff line numberDiff line change
@@ -711,11 +711,6 @@ function Buffer.create(config)
711711
buffer:set_buffer_option("buftype", config.buftype or "nofile")
712712
end
713713

714-
if config.filetype then
715-
logger.debug("[BUFFER:" .. buffer.handle .. "] Setting filetype: " .. config.filetype)
716-
buffer:set_filetype(config.filetype)
717-
end
718-
719714
if config.status_column then
720715
buffer:set_buffer_option("statuscolumn", config.status_column)
721716
buffer:set_buffer_option("signcolumn", "no")
@@ -789,6 +784,11 @@ function Buffer.create(config)
789784
-- buffer:set_window_option("winfixbuf", true)
790785
end
791786

787+
if config.filetype then
788+
logger.debug("[BUFFER:" .. buffer.handle .. "] Setting filetype: " .. config.filetype)
789+
buffer:set_filetype(config.filetype)
790+
end
791+
792792
if config.render then
793793
logger.debug("[BUFFER:" .. buffer.handle .. "] Rendering buffer")
794794
buffer.ui:render(unpack(config.render(buffer)))

0 commit comments

Comments
 (0)