Skip to content

Commit

Permalink
Use relative path for quickfix items
Browse files Browse the repository at this point in the history
Files that were open in buffers were automatically being truncated to a
relative path, but unopened files were showing the full path.
  • Loading branch information
natebosch committed May 15, 2017
1 parent 2e42c9b commit f0e1f62
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions autoload/lsc/reference.vim
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ function! s:QuickFixItem(location) abort
let item = {'lnum': a:location.range.start.line + 1,
\ 'col': a:location.range.start.character + 1}
let file_path = lsc#util#documentPath(a:location.uri)
let item.filename = file_path
let item.filename = fnamemodify(file_path, ':~:.')
let bufnr = bufnr(file_path)
if bufnr == -1
let item.text = readfile(file_path, '', item.lnum)[item.lnum - 1]
Expand Down Expand Up @@ -97,7 +97,7 @@ endfunction

function! s:goTo(file, line, character) abort
if a:file != expand('%:p')
let relative_path = fnamemodify(a:file, ":~:.")
let relative_path = fnamemodify(a:file, ':~:.')
exec 'edit '.relative_path
" 'edit' already left a jump
call cursor(a:line, a:character)
Expand Down

0 comments on commit f0e1f62

Please sign in to comment.