mirror of
https://github.com/dense-analysis/ale.git
synced 2026-11-17 01:10:41 +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:
1 parent
80dcd648d3
commit
e81f005c78
2 files changed
+14
-7
No files matched your search
@@ -347,6 +347,12 @@ function! ale#engine#FixLocList(buffer, linter_name, from_other_source, loclist)
|
||||
|
||||
if has_key(l:old_item, 'end_lnum')
|
||||
let l:item.end_lnum = str2nr(l:old_item.end_lnum)
|
||||
|
||||
" When the error ends after the end of the file, put it at the
|
||||
" end. This is only done for the current buffer.
|
||||
if l:item.bufnr == a:buffer && l:item.end_lnum > l:last_line_number
|
||||
let l:item.end_lnum = l:last_line_number
|
||||
endif
|
||||
endif
|
||||
|
||||
if has_key(l:old_item, 'sub_type')
|
||||
|
||||
Reference in new issue
Block a user