Skip to content

Commit fd38df7

Browse files
authored
fix: disable syntax highlighting for input buffer (#127)
1 parent e6e58f9 commit fd38df7

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

lua/fff/picker_ui.lua

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -437,6 +437,13 @@ function M.setup_buffers()
437437
vim.api.nvim_buf_set_option(M.state.input_buf, 'filetype', 'fff_input')
438438
vim.fn.prompt_setprompt(M.state.input_buf, M.state.config.prompt)
439439

440+
-- Changing the contents of the input buffer will trigger Neovim to guess the language in order to provide
441+
-- syntax highlighting. This makes sure that it's always off.
442+
vim.api.nvim_create_autocmd('Syntax', {
443+
buffer = M.state.input_buf,
444+
callback = function() vim.api.nvim_buf_set_option(M.state.input_buf, 'syntax', '') end,
445+
})
446+
440447
vim.api.nvim_buf_set_option(M.state.list_buf, 'buftype', 'nofile')
441448
vim.api.nvim_buf_set_option(M.state.list_buf, 'filetype', 'fff_list')
442449
vim.api.nvim_buf_set_option(M.state.list_buf, 'modifiable', false)

0 commit comments

Comments
 (0)