mirror of
https://github.com/dense-analysis/ale.git
synced 2025-12-16 01:07:06 +08:00
Fix end line number when it exceeds the file (#4130)
If the end of the error exceeds the file, set it to the last line, similarly as it is done with the beginning of the error.
This commit is contained in:
@@ -124,6 +124,7 @@ Execute(FixLocList should set items with lines beyond the end to the last line):
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 10,
|
||||
\ 'col': 0,
|
||||
\ 'end_lnum': 10,
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'vcol': 0,
|
||||
\ 'type': 'E',
|
||||
@@ -135,7 +136,7 @@ Execute(FixLocList should set items with lines beyond the end to the last line):
|
||||
\ bufnr('%'),
|
||||
\ 'foobar',
|
||||
\ 0,
|
||||
\ [{'text': 'a', 'lnum': 11}],
|
||||
\ [{'text': 'a', 'lnum': 11, 'end_lnum': 12}],
|
||||
\ )
|
||||
|
||||
Execute(FixLocList should move line 0 to line 1):
|
||||
@@ -223,9 +224,9 @@ Execute(FixLocList should pass on end_lnum values):
|
||||
\ [
|
||||
\ {
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 10,
|
||||
\ 'lnum': 7,
|
||||
\ 'col': 10,
|
||||
\ 'end_lnum': 13,
|
||||
\ 'end_lnum': 10,
|
||||
\ 'end_col': 12,
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'vcol': 0,
|
||||
@@ -235,9 +236,9 @@ Execute(FixLocList should pass on end_lnum values):
|
||||
\ },
|
||||
\ {
|
||||
\ 'text': 'a',
|
||||
\ 'lnum': 10,
|
||||
\ 'lnum': 7,
|
||||
\ 'col': 11,
|
||||
\ 'end_lnum': 13,
|
||||
\ 'end_lnum': 10,
|
||||
\ 'end_col': 12,
|
||||
\ 'bufnr': bufnr('%'),
|
||||
\ 'vcol': 0,
|
||||
@@ -251,8 +252,8 @@ Execute(FixLocList should pass on end_lnum values):
|
||||
\ 'foobar',
|
||||
\ 0,
|
||||
\ [
|
||||
\ {'text': 'a', 'lnum': '010', 'col': '010', 'end_col': '012', 'end_lnum': '013'},
|
||||
\ {'text': 'a', 'lnum': '010', 'col': '011', 'end_col': 12, 'end_lnum': 13},
|
||||
\ {'text': 'a', 'lnum': '07', 'col': '010', 'end_col': '012', 'end_lnum': '010'},
|
||||
\ {'text': 'a', 'lnum': '07', 'col': '011', 'end_col': 12, 'end_lnum': 10},
|
||||
\ ],
|
||||
\ )
|
||||
|
||||
|
||||
Reference in New Issue
Block a user