summaryrefslogtreecommitdiff
path: root/autoload
diff options
context:
space:
mode:
authorLittleKey <LittleKeyRain@gmail.com>2023-07-24 09:37:49 +0800
committerGitHub <noreply@github.com>2023-07-24 10:37:49 +0900
commit969f7b080f900d5751918ea23dfe14ffd3030b76 (patch)
treea6079b625debc331542fe35827d0dac66c55197a /autoload
parent7ba88ad343c57f69a2fb2469eded51a3bbd4813b (diff)
downloadale-969f7b080f900d5751918ea23dfe14ffd3030b76.zip
Add end_col of matched forbidden word (#4556)
Diffstat (limited to 'autoload')
-rw-r--r--autoload/ale/handlers/cspell.vim9
1 files changed, 7 insertions, 2 deletions
diff --git a/autoload/ale/handlers/cspell.vim b/autoload/ale/handlers/cspell.vim
index 2cd02d5c..6137bdeb 100644
--- a/autoload/ale/handlers/cspell.vim
+++ b/autoload/ale/handlers/cspell.vim
@@ -24,14 +24,19 @@ endfunction
function! ale#handlers#cspell#Handle(buffer, lines) abort
" Look for lines like the following:
"
- " /home/user/repos/ale/README.md:723:48 - Unknown word (stylelint)
- let l:pattern = '\v^.*:(\d+):(\d+) - (.*)$'
+ " /home/user/repos/ale/README.md:3:128 - Unknown word (Neovim)
+ " match1: 3
+ " match2: 128
+ " match3: Unknown word (Neovim)
+ " match4: Neovim
+ let l:pattern = '\v^.*:(\d+):(\d+) - ([^\(]+\(([^\)]+)\).*)$'
let l:output = []
for l:match in ale#util#GetMatches(a:lines, l:pattern)
call add(l:output, {
\ 'lnum': l:match[1] + 0,
\ 'col': l:match[2] + 0,
+ \ 'end_col': l:match[2] + len(l:match[4]) - 1,
\ 'text': l:match[3],
\ 'type': 'W',
\})