diff options
author | w0rp <w0rp@users.noreply.github.com> | 2020-11-21 16:16:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-21 16:16:08 +0000 |
commit | edd96f44148ec1877cf031417eab764a266ed32b (patch) | |
tree | e93e2bfc4b94b2d1f4e4b55a2eb73089cdc2c850 /autoload | |
parent | d23c9125c53d9ecd84a8c49002b4bc412dca0b25 (diff) | |
parent | 9769565f882b43512105d1b63a2f4ceda7a39d86 (diff) | |
download | ale-edd96f44148ec1877cf031417eab764a266ed32b.zip |
Merge pull request #3354 from rphln/collapse-whitespaces
Collapse spaces and lines in the completion menu.
Diffstat (limited to 'autoload')
-rw-r--r-- | autoload/ale/completion.vim | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/autoload/ale/completion.vim b/autoload/ale/completion.vim index 48e9bf7c..39bfc094 100644 --- a/autoload/ale/completion.vim +++ b/autoload/ale/completion.vim @@ -606,11 +606,14 @@ function! ale#completion#ParseLSPCompletions(response) abort let l:doc = l:doc.value endif + " Collapse whitespaces and line breaks into a single space. + let l:detail = substitute(get(l:item, 'detail', ''), '\_s\+', ' ', 'g') + let l:result = { \ 'word': l:word, \ 'kind': ale#completion#GetCompletionSymbols(get(l:item, 'kind', '')), \ 'icase': 1, - \ 'menu': get(l:item, 'detail', ''), + \ 'menu': l:detail, \ 'info': (type(l:doc) is v:t_string ? l:doc : ''), \} " This flag is used to tell if this completion came from ALE or not. |