fix: disable syntax highlighting for input buffer#127
Merged
dmtrKovalenko merged 1 commit intodmtrKovalenko:mainfrom Aug 23, 2025
Merged
Conversation
| -- syntax highlighting. This makes sure that it's always off. | ||
| vim.api.nvim_create_autocmd('Syntax', { | ||
| buffer = M.state.input_buf, | ||
| callback = function() vim.api.nvim_buf_set_option(M.state.input_buf, 'syntax', '') end, |
Owner
There was a problem hiding this comment.
why do we need to do this on autocmd if we can set the option directly on a buffer when creating it
Contributor
Author
There was a problem hiding this comment.
Owner
Contributor
Author
|
I just double checked and it works for me. Can you open a new neovim instance, open fff and run |
Owner
|
this is what I get while there is still syntax highlighting |
Owner
|
sorry it's me being dumb |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



When
syntaxis enabled Neovim tries really hard to provide syntax highlighting. This is the simplest way I found to disable it for just one buffer.Setting
syntax = ''when the buffer is created is not enough, it will get overwritten on changes to the buffer and settingsyntax = ''on buffer change wasn't 100% reliable for some reason.Buffer scoped autocmds are cleaned up when the buffer is destroyed.
Fixes: #112