Strip trailing slash from REPL root

Also, use a ~ path, if possible.

References #13.
This commit is contained in:
Tim Pope 2012-12-10 17:24:28 -05:00
parent 8b13cb2fe8
commit f1f9276bbe
1 changed files with 2 additions and 2 deletions

View File

@ -233,10 +233,10 @@ function! s:Connect(arg)
endif endif
let client = s:register_connection(connection) let client = s:register_connection(connection)
echo 'Connected to '.proto.'://'.arg echo 'Connected to '.proto.'://'.arg
let path = exists('b:java_root') ? b:java_root : fnamemodify(expand('%'), ':p:s?.*\zs[\/]src[\/].*??') let path = fnamemodify(exists('b:java_root') ? b:java_root : fnamemodify(expand('%'), ':p:s?.*\zs[\/]src[\/].*??'), ':~')
let root = input('Path to root of project: ', path, 'dir') let root = input('Path to root of project: ', path, 'dir')
if root !=# '' if root !=# ''
let s:repl_paths[root] = client let s:repl_paths[fnamemodify(root, ':p:s?[\/]$??')] = client
endif endif
return '' return ''
endfunction endfunction