Skip to content

Commit

Permalink
Reload settings when filetype is changed
Browse files Browse the repository at this point in the history
Fixes #2712
  • Loading branch information
zyedidia committed Jan 27, 2023
1 parent d5ff785 commit 3ef0267
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions internal/buffer/settings.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,16 @@ func (b *Buffer) SetOptionNative(option string, nativeValue interface{}) error {
} else if option == "statusline" {
screen.Redraw()
} else if option == "filetype" {
config.InitRuntimeFiles()
err := config.ReadSettings()
if err != nil {
screen.TermMessage(err)
}
err = config.InitGlobalSettings()
if err != nil {
screen.TermMessage(err)
}
config.InitLocalSettings(b.Settings, b.Path)
b.UpdateRules()
} else if option == "fileformat" {
switch b.Settings["fileformat"].(string) {
Expand Down

0 comments on commit 3ef0267

Please sign in to comment.