Skip to content

Commit

Permalink
#574 Do not restore items with no columns for highlights from hidden …
Browse files Browse the repository at this point in the history
…buffers
  • Loading branch information
w0rp committed Jun 2, 2017
1 parent 9b6d634 commit 76b5c92
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
6 changes: 5 additions & 1 deletion autoload/ale/highlight.vim
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,11 @@ function! ale#highlight#BufferHidden(buffer) abort
endif
endfor

let s:buffer_restore_map[a:buffer] = l:loclist
let s:buffer_restore_map[a:buffer] = filter(
\ copy(l:loclist),
\ 'v:val.bufnr == a:buffer && v:val.col > 0'
\)

call clearmatches()
endif
endfunction
Expand Down
2 changes: 2 additions & 0 deletions test/test_highlight_placement.vader
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,10 @@ Execute(Highlights set by ALE should be removed when buffer cleanup is done):

Execute(Highlights should be cleared when buffers are hidden):
call ale#engine#InitBufferInfo(bufnr('%'))
" The second item should be ignored, as it has no column infomration.
let g:ale_buffer_info[bufnr('%')].loclist = [
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 3, 'col': 2},
\ {'bufnr': bufnr('%'), 'type': 'E', 'lnum': 4, 'col': 0},
\]
call ale#highlight#SetHighlights(
\ bufnr('%'),
Expand Down

0 comments on commit 76b5c92

Please sign in to comment.