" ingo/compat/command.vim: Compatibility functions for commands. " " DEPENDENCIES: " " Copyright: (C) 2017-2019 Ingo Karkat " The VIM LICENSE applies to this script; see ':help copyright'. " " Maintainer: Ingo Karkat " " REVISION DATE REMARKS " 1.030.001 20-Feb-2017 file creation function! ingo#compat#command#Mods( mods ) "****************************************************************************** "* PURPOSE: " Return the command modifiers || passed in raw as a:mods. " In order to support older Vim versions that don't have this (prior to " Vim 7.4.1898), one cannot use ; this isn't understood and raises an " error. Instead, we can benefit from the fact that the modifiers do not " contain special characters, and do the quoting ourselves: ''. Now we " only need to remove the identifer in case it hasn't been understood, and " this is what this function is about. " -command! Sedit call SpecialEdit() " +command! Sedit call SpecialEdit(ingo#compat#command#Mods('')) "* ASSUMPTIONS / PRECONDITIONS: " None. "* EFFECTS / POSTCONDITIONS: " None. "* INPUTS: " '' "* RETURN VALUES: " Usable modifiers. "****************************************************************************** return (a:mods ==# '' ? '' : a:mods) endfunction " vim: set ts=8 sts=4 sw=4 noexpandtab ff=unix fdm=syntax :