File tree Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Expand file tree Collapse file tree 3 files changed +14
-4
lines changed Original file line number Diff line number Diff line change @@ -377,6 +377,9 @@ function M.get(winid)
377377 local range0 = context_range (parent , bufnr , query )
378378 if range0 and range_is_valid (range0 ) then
379379 local range , lines = get_text_for_range (range0 , bufnr )
380+ if range [1 ] > contexts_end_row - 1 then
381+ return
382+ end
380383 if range_is_valid (range ) then
381384 local last_context = context_ranges [# context_ranges ]
382385 if last_context and parent_start_row == last_context [1 ] then
Original file line number Diff line number Diff line change 33) @context
44
55(method_declaration
6+ type: (_) @context.start
7+ body: (_) @context.end
8+ ) @context
9+
10+ (constructor_declaration
11+ name: (_) @context.start
612 body: (_) @context.end
713) @context
814
1521) @context
1622
1723(class_declaration
24+ name: (_) @context.start
1825 body: (_) @context.end
1926) @context
2027
Original file line number Diff line number Diff line change 33import stuff1 ;
44import stuff2 ;
55
6- @ class_annot_1 // {{CONTEXT}}
7- @ class_annot_2 // {{CONTEXT}}
6+ @ class_annot_1
7+ @ class_annot_2
88public class MyClass { // {{CONTEXT}}
99
1010
1111
1212 // {{CURSOR}}
13- @ method_annot_1 // {{CONTEXT}}
14- @ method_annot_2 // {{CONTEXT}}
13+ @ method_annot_1
14+ @ method_annot_2
1515 public void my_method (int param ) { // {{CONTEXT}}
1616
1717
You can’t perform that action at this time.
0 commit comments