From 87a26c5bf169bafbee837e2323f24cfb07e35250 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 21 Dec 2021 14:41:23 +0100 Subject: Update --- ftplugin/ruby.vim | 40 ++++++++++++++++++++++++---------------- 1 file changed, 24 insertions(+), 16 deletions(-) (limited to 'ftplugin/ruby.vim') diff --git a/ftplugin/ruby.vim b/ftplugin/ruby.vim index 1c6f828f..fcf346a0 100644 --- a/ftplugin/ruby.vim +++ b/ftplugin/ruby.vim @@ -90,8 +90,14 @@ endfunction function! s:build_path(path) abort let path = join(map(copy(a:path), 'v:val ==# "." ? "" : v:val'), ',') - if &g:path !~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' - let path = substitute(&g:path,',,$',',','') . ',' . path + if &g:path =~# '\v^%(\.,)=%(/%(usr|emx)/include,)=,$' + let path = path . ',.,,' + elseif &g:path =~# ',\.,,$' + let path = &g:path[0:-4] . path . ',.,,' + elseif &g:path =~# ',,$' + let path = &g:path[0:-2] . path . ',,' + else + let path = substitute(&g:path, '[^,]\zs$', ',', '') . path endif return path endfunction @@ -167,6 +173,8 @@ let b:undo_ftplugin .= "| sil! cunmap | sil! cunmap