Просмотр исходного кода

Avoid textual substitution of `$HOME` -> `~` in paths.

- Undesirable substitution could occur anywhere in the path (not just at
  the start).  Shortening for paths in `$HOME` is now done via
  `homename` and associated variables from `s:types`.
Michael Henry 11 месяцев назад
Родитель
Сommit
f0e453eabe
1 измененных файлов с 3 добавлено и 3 удалено
  1. 3 3
      plugin/bufexplorer.vim

+ 3 - 3
plugin/bufexplorer.vim

@@ -812,12 +812,12 @@ function! s:BuildBufferList()
         " Are we to split the path and file name?
         if g:bufExplorerSplitOutPathName
             let type = (g:bufExplorerShowRelativePath) ? "relativepath" : "path"
-            let path = substitute( buf[type], $HOME."\\>", "~", "" )
+            let path = buf[type]
             let pad  = (g:bufExplorerShowUnlisted) ? s:allpads.shortname : s:listedpads.shortname
             let line .= buf.shortname." ".strpart(pad.path, s:StringWidth(buf.shortname))
         else
-            let type = (g:bufExplorerShowRelativePath) ? "relativename" : "fullname"
-            let path = substitute( buf[type], $HOME."\\>", "~", "" )
+            let type = (g:bufExplorerShowRelativePath) ? "relativename" : "homename"
+            let path = buf[type]
             let line .= path
         endif