mirror of
https://github.com/ilyakooo0/helix.git
synced 2024-08-17 03:50:21 +03:00
Fix precedence order of @align captures in indent computation (#8659)
precedence when multiple occur on the same line in an indent query.
This commit is contained in:
parent
f992c3b597
commit
ef0c31db02
@ -271,7 +271,9 @@ fn add_line(&mut self, added: Indentation) {
|
||||
}
|
||||
|
||||
/// Add an indent capture to this indent.
|
||||
/// All the captures that are added in this way should be on the same line.
|
||||
/// Only captures that apply to the same line should be added together in this way (otherwise use `add_line`)
|
||||
/// and the captures should be added starting from the innermost tree-sitter node (currently this only matters
|
||||
/// if multiple `@align` patterns occur on the same line).
|
||||
fn add_capture(&mut self, added: IndentCaptureType) {
|
||||
match added {
|
||||
IndentCaptureType::Indent => {
|
||||
@ -295,7 +297,9 @@ fn add_capture(&mut self, added: IndentCaptureType) {
|
||||
self.outdent = 0;
|
||||
}
|
||||
IndentCaptureType::Align(align) => {
|
||||
self.align = Some(align);
|
||||
if self.align.is_none() {
|
||||
self.align = Some(align);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user