Set a filetype for the results buffer (#1019)

**Why** is the change needed?

So that it can be targeted with specific settings. These could include disabling
plugins for the buffer (as in #840) or disabling folding (as per #991).

**How** is the need addressed?

- Add a filetype to the buffer after it has been created.

Closes #991
This commit is contained in:
Rasmus Bergström
2021-07-18 10:12:04 +02:00
committed by GitHub
parent 87fecbea95
commit 1bb73aed5f

View File

@@ -471,6 +471,7 @@ function Picker:find()
-- Do filetype last, so that users can register at the last second. -- Do filetype last, so that users can register at the last second.
pcall(a.nvim_buf_set_option, prompt_bufnr, 'filetype', 'TelescopePrompt') pcall(a.nvim_buf_set_option, prompt_bufnr, 'filetype', 'TelescopePrompt')
pcall(a.nvim_buf_set_option, results_bufnr, 'filetype', 'TelescopeResults')
if self.default_text then if self.default_text then
self:set_prompt(self.default_text) self:set_prompt(self.default_text)