From 7c6d4779f68f2243dbb46342db94ae6654e5ebd7 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Tue, 22 Oct 2019 19:01:14 +0200 Subject: [PATCH 1/2] Overwrite exported command and function, used endfunction instead of endfunc --- autoload/splitopen.vim | 18 +++++++++--------- plugin/splitopen.vim | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/autoload/splitopen.vim b/autoload/splitopen.vim index b4488ba..278a532 100644 --- a/autoload/splitopen.vim +++ b/autoload/splitopen.vim @@ -4,18 +4,18 @@ function s:invert_dict(source_dict) let result[value] = key endfor return result -endfunc +endfunction let s:extensions = g:splitopen_extensions let s:extensions_rev = s:invert_dict(s:extensions) function s:isLeftSideExtension(extension) return has_key(s:extensions, a:extension) -endfunc +endfunction function s:isRightSideExtension(extension) return has_key(s:extensions_rev, a:extension) -endfunc +endfunction function s:getFileExtension(filename) return fnamemodify(a:filename, ":e") @@ -23,7 +23,7 @@ endfunction function s:getFileRoot(filename) return fnamemodify(a:filename, ":r") -endfunc +endfunction function s:getSwitchExtension(filename) let extension = s:getFileExtension(a:filename) @@ -32,24 +32,24 @@ function s:getSwitchExtension(filename) elseif s:isRightSideExtension(extension) return s:extensions_rev[extension] endif -endfunc +endfunction function s:getSwitchFile(filename) return s:getFileRoot(a:filename) . "." . s:getSwitchExtension(a:filename) -endfunc +endfunction function s:addLeftSplit(filename) execute("vsplit " . s:getSwitchFile(a:filename)) execute("wincmd l") -endfunc +endfunction function s:addRightSplit(filename) execute("vsplit " . s:getSwitchFile(a:filename)) execute("wincmd L") execute("wincmd h") -endfunc +endfunction -function splitopen#SplitOpenFile(filename) +function! splitopen#SplitOpenFile(filename) execute("tabedit " . a:filename) let extension = s:getFileExtension(a:filename) if s:isLeftSideExtension(extension) diff --git a/plugin/splitopen.vim b/plugin/splitopen.vim index 7f54b02..ed08d08 100644 --- a/plugin/splitopen.vim +++ b/plugin/splitopen.vim @@ -1,4 +1,4 @@ -command -nargs=1 SplitOpen :call splitopen#SplitOpenFile("") +command! -nargs=1 SplitOpen :call splitopen#SplitOpenFile("") " map left-split / right-split file extensions if !exists("g:splitopen_extensions") From d12fde2ddcdc1e1eadac1b663208a372f4a5d1d4 Mon Sep 17 00:00:00 2001 From: Michael Mandl Date: Wed, 30 Oct 2019 22:21:59 +0100 Subject: [PATCH 2/2] Updated release notes --- README.md | 3 +++ doc/splitopen.txt | 2 ++ 2 files changed, 5 insertions(+) diff --git a/README.md b/README.md index 9418060..3f831cf 100644 --- a/README.md +++ b/README.md @@ -41,6 +41,9 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ## Changelog +v1.0.0 +* Fixed error when reloading plugin + v0.0.4 * Add filetype configuraton diff --git a/doc/splitopen.txt b/doc/splitopen.txt index 55e954d..30cf547 100644 --- a/doc/splitopen.txt +++ b/doc/splitopen.txt @@ -55,6 +55,8 @@ SplitOpen is GPL-3.0 licensed. See LICENSE file for more info. ================================================================================ 4. Changelog *SplitOpenChangelog* +v1.0.0 + * Fixed error when reloading plugin v0.0.4 * Add filetype configuraton v0.0.3