From 93335f7068926bb3a90e97f51ad9903a56a7d8dd Mon Sep 17 00:00:00 2001 From: Nate Bosch Date: Sun, 23 Apr 2017 15:55:07 -0700 Subject: [PATCH] Don't try to 'edit' the current file 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 --- CHANGELOG.md | 3 ++- autoload/lsc/reference.vim | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 3f985ef0..2b1363a8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,4 @@ -# 0.1.1-dev +# 0.1.1 - Call initialize first for better protocol compliance - Use a relative path where possible when jumping to definition @@ -6,6 +6,7 @@ - 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 diff --git a/autoload/lsc/reference.vim b/autoload/lsc/reference.vim index 0aa92690..c282476f 100644 --- a/autoload/lsc/reference.vim +++ b/autoload/lsc/reference.vim @@ -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