feat(api): add filetype option nvim_get_option_value

- Also adjust the expr-mapping behaviour so normal commands and text
  changes are allowed in internal dummy buffers.
This commit is contained in:
Lewis Russell
2023-03-15 23:30:14 +00:00
parent 84027f7515
commit e1db0e35e4
10 changed files with 95 additions and 11 deletions

View File

@@ -1969,6 +1969,10 @@ nvim_get_option_value({name}, {*opts}) *nvim_get_option_value()*
• win: |window-ID|. Used for getting window local options.
• buf: Buffer number. Used for getting buffer local options.
Implies {scope} is "local".
• filetype: |filetype|. Used to get the default option for a
specific filetype. Cannot be used with any other option.
Note: this is expensive, it is recommended to cache this
value.
Return: ~
Option value

View File

@@ -210,6 +210,9 @@ The following new APIs or features were added.
https://tree-sitter.github.io/tree-sitter/syntax-highlighting#language-injection .
Support for the previous format will be removed in a future release.
• |nvim_get_option_value()| now has a `filetype` option so it can return the
default option for a specific filetype.
==============================================================================
CHANGED FEATURES *news-changes*