From 3eff99cd8f3fd17c0d8e50698950ed83e405ee31 Mon Sep 17 00:00:00 2001 From: Roy-Orbison Date: Wed, 23 Dec 2020 15:46:15 +1030 Subject: [PATCH] Preserve split prefs They are global settings and get overwritten every time fff#Run() is invoked. --- autoload/fff.vim | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/autoload/fff.vim b/autoload/fff.vim index e4c5772..3e22c19 100644 --- a/autoload/fff.vim +++ b/autoload/fff.vim @@ -28,7 +28,11 @@ function! fff#open_file(...) endfunction function! fff#Run(command) - execute 'setlocal' . ' ' . g:fff#split_direction + let split_direction = (&splitbelow ? '' : 'no') . 'splitbelow ' + \ . (&splitright ? '' : 'no') . 'splitright' + if (split_direction != g:fff#split_direction) + execute 'set ' . g:fff#split_direction + endif execute g:fff#split execute 'setlocal nonumber' execute 'setlocal norelativenumber' @@ -45,4 +49,7 @@ function! fff#Run(command) call term_wait(buffer, 20) endif endif + if (split_direction != g:fff#split_direction) + execute 'set ' . split_direction + endif endfunction