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

View File

@ -233,10 +233,10 @@ function! s:Connect(arg)
endif
let client = s:register_connection(connection)
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')
if root !=# ''
let s:repl_paths[root] = client
let s:repl_paths[fnamemodify(root, ':p:s?[\/]$??')] = client
endif
return ''
endfunction