Skip to content

Commit

Permalink
[Command Line] excluded
Browse files Browse the repository at this point in the history
 + :Install will return if: b:ftplugin_installdir is equal to
   b:ftplugin_dir, or b:ftplugin_installdir is empty or if there is
   a bang and b:ftplugin_dir is empty.
  • Loading branch information
coot committed Oct 5, 2012
1 parent 8b857b4 commit 7a9d5f2
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ftplugin/vim_ftpdev.vim
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ endif
let s:vim_dirs = [ "ftplugin", "plugin", "autoload", "compiler", "syntax",
\ "indent", "colors", "doc", "keymap", "lang", "macros", "print",
\ "spell", "tools", "tutor", ]
let dir_path = ''
if !exists("b:ftplugin_dir")
if expand("%:p:h") == $HOME
if expand("%:t") == "[Command Line]"
let b:ftplugin_dir = ''
elseif expand("%:p:h") == $HOME
let b:ftplugin_dir = $HOME
echohl WarningMsg
echom "[ftpdev warning]: b:ftplugin_dir=\"".b:ftplugin_dir."\""
Expand All @@ -28,7 +31,6 @@ if !exists("b:ftplugin_dir")
try
" XXX: Fugitive ... :Gdiff
exe "lcd ".fnameescape(expand('%:p:h'))
let dir_path = ''
for dir in s:vim_dirs
let dir_path = fnamemodify(finddir(dir, expand("%:p:h").';'), ':p')
if !empty(dir_path)
Expand All @@ -45,6 +47,8 @@ if !exists("b:ftplugin_dir")
let b:ftplugin_dir = expand("%:p:h")
endtry
endif
else
let dir_path = b:ftplugin_dir
endif
fun! FTPDEV_GetInstallDir() " {{{
let time = reltime()
Expand Down Expand Up @@ -102,7 +106,9 @@ fun! FTPDEV_GetInstallDir() " {{{
return ipath
endfun "}}}
if !exists("b:ftplugin_installdir")
if empty(dir_path)
if expand("%:t") == "[Command Line]"
let b:ftplugin_installdir = ''
elseif empty(dir_path)
let b:ftplugin_installdir = split(&rtp, ',')[0]
echohl WarningMsg
echom "[ftpdev warning]: b:ftplugin_installdir=\"".b:ftplugin_installdir."\""
Expand Down Expand Up @@ -584,7 +590,9 @@ nmap ]# :call searchpair('^[^"]*\<\zsif\>', '^[^"]*\<\zselse\%(if\)\=\>', '^[^"]
nmap [# :call searchpair('^[^"]*\<\zsif\>', '^[^"]*\<\zselse\%(if\)\=\>', '^[^"]*\<\zsendif\>', 'b')<CR>
fun! <SID>Install(bang) "{{{1
if b:ftplugin_dir == b:ftplugin_installdir
if b:ftplugin_dir == b:ftplugin_installdir ||
\ empty(b:ftplugin_installdir) ||
\ a:bang == "!" && empty(b:ftplugin_dir)
return
endif

Expand Down

0 comments on commit 7a9d5f2

Please sign in to comment.