Last active
August 29, 2015 14:05
-
-
Save tyru/5bed4d937ae83133342a to your computer and use it in GitHub Desktop.
Empty CmdWin Bufname
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
scriptencoding utf-8 | |
source spec/base.vim | |
let g:VB = vital#of('vital').import('Vim.Buffer') | |
Context Vim.Buffer.is_cmdwin() | |
It detects if current window is cmdwin. | |
" normal! q: | |
let save_cedit = &cedit | |
let &cedit = "<C-f>" | |
try | |
execute "normal! :\<C-f>\<CR>" | |
Should g:VB.is_cmdwin() | |
quit | |
Should !g:VB.is_cmdwin() | |
finally | |
let &cedit = save_cedit | |
endtry | |
End | |
End | |
" (以下省略) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let s:save_cpo = &cpo | |
set cpo&vim | |
function! s:_vital_loaded(V) | |
let s:V = a:V | |
let s:P = s:V.import('Prelude') | |
endfunction | |
function! s:_vital_depends() | |
return ['Prelude'] | |
endfunction | |
function! s:is_cmdwin() | |
echom string(bufname('%')) | |
sleep 5 | |
return bufname('%') ==# '[Command Line]' | |
endfunction | |
" (以下省略) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment