# HG changeset patch # User Ludovic Chabant # Date 1601013356 25200 # Node ID ff4590b2503ad45d7c9d70565a9f5e42941bab79 # Parent 376f3371c31182c720d0cc8bf7749abc0b826433 Fix handling of spaces in configs/platforms for autocomplete. diff -r 376f3371c311 -r ff4590b2503a autoload/vimcrosoft.vim --- a/autoload/vimcrosoft.vim Thu Sep 24 22:54:02 2020 -0700 +++ b/autoload/vimcrosoft.vim Thu Sep 24 22:55:56 2020 -0700 @@ -346,7 +346,7 @@ endfunction function! vimcrosoft#set_config_platform(configplatform) - let l:bits = split(a:configplatform, '|') + let l:bits = split(substitute(a:configplatform, '\\ ', ' ', 'g'), '|') if len(l:bits) != 2 call vimcrosoft#throw("Expected a value of the form: Config|Platform") endif @@ -393,11 +393,11 @@ endfunction function! vimcrosoft#complete_current_sln_config_platforms(ArgLead, CmdLine, CursorPos) + let l:argpat = '^'.substitute(a:ArgLead, '\', '', 'g') let l:cfgplats = vimcrosoft#get_sln_config_platforms() - let l:argpat = '^'.substitute(a:ArgLead, '\', '', 'g') - let l:cfgplatnames = filter(l:cfgplats, - \{idx, val -> val =~? l:argpat}) - return l:cfgplatnames + let l:cfgplats_filtered = filter(l:cfgplats, {idx, val -> val =~? l:argpat}) + call map(l:cfgplats_filtered, {idx, val -> escape(val, ' ')}) + return l:cfgplats_filtered endfunction " }}}