Skip to content

Commit

Permalink
Don't try to 'edit' the current file
Browse files Browse the repository at this point in the history
When jumping to a definition in the current file, if it was unsaved
there would be a warning because 'edit' doesn't mean go to the file, it
means read from disk.

Prepare for taggint as 0.1.1
  • Loading branch information
natebosch committed Apr 23, 2017
1 parent e0ea69d commit 93335f7
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
# 0.1.1-dev
# 0.1.1

- Call initialize first for better protocol compliance
- Use a relative path where possible when jumping to definition
- Only display 'message' field for errors
- Bug Fix: Less likely to delete inserted text when trying to complete
- Bug Fix: More likely to try to complete when not following a '.'
- Populate location list with diagnostics
- Bug fix: Don't try to 'edit' the current file

# 0.1.0

Expand Down
6 changes: 4 additions & 2 deletions autoload/lsc/reference.vim
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ function! s:isGoToValid(old_pos, goto_definition_id) abort
endfunction

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

0 comments on commit 93335f7

Please sign in to comment.