From a354439228a003e60362e81114c8e189d12e02ff Mon Sep 17 00:00:00 2001 From: Ilia Choly Date: Wed, 29 Apr 2015 16:14:40 -0400 Subject: [PATCH] Add g:tsuquyomi_definition_split --- autoload/tsuquyomi.vim | 2 ++ doc/tsuquyomi.txt | 6 ++++++ plugin/tsuquyomi.vim | 2 ++ 3 files changed, 10 insertions(+) diff --git a/autoload/tsuquyomi.vim b/autoload/tsuquyomi.vim index fe38531..9e09228 100644 --- a/autoload/tsuquyomi.vim +++ b/autoload/tsuquyomi.vim @@ -319,6 +319,8 @@ function! tsuquyomi#definition() " Same file call tsuquyomi#bufManager#pushNavDef(l:file, {'line': l:line, 'col': l:offset}) call cursor(l:info.start.line, l:info.start.offset) + elseif g:tsuquyomi_definition_split == 0 + execute 'edit +call\ cursor('.l:info.start.line.','.l:info.start.offset.') '.l:info.file else " If other file, split window execute 'split +call\ cursor('.l:info.start.line.','.l:info.start.offset.') '.l:info.file diff --git a/doc/tsuquyomi.txt b/doc/tsuquyomi.txt index a09f295..cd19395 100644 --- a/doc/tsuquyomi.txt +++ b/doc/tsuquyomi.txt @@ -198,6 +198,12 @@ g:tsuquyomi_tsserver_path (default `''`) g:tsuquyomi_nodejs_path (default 'node') A path to Node.js. + + g:tsuquyomi_definition_split +g:tsuquyomi_definition_split (default 1) + Whether to open a new split when navigating to definition in + another file. See :TsuquyomiDefinition. + ------------------------------------------------------------------------------ KEY MAPPINGS *tsuquyomi-key-mappings* diff --git a/plugin/tsuquyomi.vim b/plugin/tsuquyomi.vim index d9a7d7b..e717979 100644 --- a/plugin/tsuquyomi.vim +++ b/plugin/tsuquyomi.vim @@ -36,6 +36,8 @@ let g:tsuquyomi_waittime_after_open= \ get(g:, 'tsuquyomi_waittime_after_open', 0.01) let g:tsuquyomi_completion_chank_size = \ get(g:, 'tsuquyomi_completion_chank_size', 15) +let g:tsuquyomi_definition_split = + \ get(g:, 'tsuquyomi_definition_split', 1) " Global options defintion. }}} " augroup tsuquyomi_global_command_group