Closed denstiny closed 3 years ago
I think you want labeled_statement
labeled_statement
Yes, what should I do
add it to vim.g.indent_blankline_context_patterns
indent_blankline_context_patterns
I this is to join in, but he is invalid
My configuration
vim.g.indent_blankline_show_current_context = true
vim.g.indent_blankline_context_patterns = {
'class',
'function',
'method',
'^if',
'^while',
'^typedef',
'^for',
'^object',
'^table',
'block',
'arguments',
'typedef',
'while',
'^public',
'return',
'if_statement',
'else_clause',
'jsx_element',
'jsx_self_closing_element',
'try_statement',
'catch_clause',
'import_statement'
}
vim.g.indent_blankline_char = '│'
-- 设置特定缓冲区不起用
vim.g.indent_blankline_filetype_exclude = {'help','startify','nerdtree'}
like this
vim.g.indent_blankline_context_patterns = {
'class',
'function',
'method',
'^if',
'^while',
'^typedef',
'^for',
'^object',
'^table',
'block',
'arguments',
'typedef',
'while',
'^public',
'return',
'if_statement',
'else_clause',
'jsx_element',
'jsx_self_closing_element',
'try_statement',
'catch_clause',
'import_statement',
'labeled_statement'
}
I'm sorry it didn't what effect
Then I don't understand your problem. Can you try to explain it again
那我不明白你的问题。 你能不能再解释一遍
My rules don't work for the public
vim.g.indent_blankline_context_patterns = {
'^public',
}
indent_blankline_context_patterns
does not match your code.
It matches against the treesitter node type.
The type of that public statement in C is labeled_statement
It works for me to just add it to the list.
thank you