diff options
author | pommicket <pommicket@gmail.com> | 2023-03-02 09:53:11 -0500 |
---|---|---|
committer | pommicket <pommicket@gmail.com> | 2023-03-02 09:53:11 -0500 |
commit | 595cc50b7985ec67c49c6e2ffc649cb04692a318 (patch) | |
tree | 970ab71aadabc9f0f0a7a1634512c31aedd23188 /buffer.c | |
parent | 6d9ebc8332b6cc54ada4bc17689e4de4040892c6 (diff) |
dynamic language registration working
Diffstat (limited to 'buffer.c')
-rw-r--r-- | buffer.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -222,8 +222,9 @@ Language buffer_language(TextBuffer *buffer) { // @TODO(optimization): cache this? // (we're calling buffer_lsp on every edit and that calls this) - if (buffer->manual_language >= 1) - return (Language)(buffer->manual_language - 1); + + if (buffer->manual_language != LANG_NONE) + return (Language)buffer->manual_language; const Settings *settings = buffer->ted->default_settings; // important we don't use buffer_settings here since that would cause a loop! const char *filename = path_filename(buffer->path); size_t filename_len = strlen(filename); |