changeset 7:ff4590b2503a

Fix handling of spaces in configs/platforms for autocomplete.
author Ludovic Chabant <ludovic@chabant.com>
date Thu, 24 Sep 2020 22:55:56 -0700
parents 376f3371c311
children d5ddd9ffaf11
files autoload/vimcrosoft.vim
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
 
 " }}}