mirror of
https://github.com/nvim-treesitter/nvim-treesitter.git
synced 2026-07-01 19:17:02 -04:00
Add implementation for improved statusline. Closes #545.
This commit is contained in:
parent
030a75129d
commit
62df1143da
3 changed files with 77 additions and 0 deletions
|
|
@ -423,6 +423,27 @@ could be used as a statusline indicator.
|
|||
Note: The `size` argument is optional. When specified, the string will not be
|
||||
longer than `size`.
|
||||
|
||||
*nvim_treesitter#named_statusline()*
|
||||
nvim_treesitter#named_statusline(opts)~
|
||||
|
||||
Returns a string describing the current position in the file. This
|
||||
could be used as a statusline indicator.
|
||||
Default options (lua syntax):
|
||||
>
|
||||
{
|
||||
indicator_size = 100,
|
||||
type_patterns = {'class', 'function', 'method'},
|
||||
transform_fn = function(line) return line:gsub('[%[%(%{]*%s*$', '') end,
|
||||
separator = ' -> '
|
||||
}
|
||||
<
|
||||
- `indicator_size` - How long should the string be. If longer, it is cut from
|
||||
the beginning.
|
||||
- `type_patterns` - Which node type patterns to match.
|
||||
- `transform_fn` - Function used to transform the single item in line. By
|
||||
default removes opening brackets and spaces from end.
|
||||
- `separator` - Separator between nodes.
|
||||
|
||||
*nvim_treesitter#foldexpr()*
|
||||
nvim_treesitter#foldexpr()~
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue