fix: errors when autocmd AutoSaveFolds
This commit is contained in:
parent
8eb1efae5e
commit
a41c581174
30
vimrc
30
vimrc
|
@ -724,7 +724,7 @@ function! s:RunShellCommand(cmdline) abort"{{{
|
|||
" Shell command
|
||||
" http://vim.wikia.com/wiki/VimTip1599
|
||||
|
||||
let l:expanded_cmdline = a:cmdline
|
||||
let l:expanded_cmdline = a:cmdline
|
||||
for l:part in split(a:cmdline, ' ')
|
||||
if l:part[0] =~ '\v[%#<]'
|
||||
let l:expanded_part = fnameescape(expand(l:part))
|
||||
|
@ -749,7 +749,7 @@ function! s:RunShellCommand(cmdline) abort"{{{
|
|||
endif
|
||||
|
||||
setlocal buftype=nofile bufhidden=wipe nobuflisted noswapfile nowrap
|
||||
nnoremap <buffer> q :bdelete<CR>
|
||||
nnoremap <buffer> q :bdelete<CR>
|
||||
augroup ResetShellBufferNr
|
||||
autocmd! * <buffer>
|
||||
autocmd BufUnload <buffer> let g:shell_scratch_buffer_nr = -1
|
||||
|
@ -980,7 +980,7 @@ set showmode
|
|||
|
||||
set autoindent
|
||||
set breakindent
|
||||
set showbreak=\ \ ↳\
|
||||
set showbreak=\ \ ↳\
|
||||
|
||||
set mouse=a
|
||||
|
||||
|
@ -1148,15 +1148,15 @@ augroup AutoSaveFolds
|
|||
" autocmd BufWinLeave ?* mkview
|
||||
autocmd BufWrite ?* mkview
|
||||
" autocmd BufWinEnter ?* silent loadview
|
||||
autocmd BufRead ?* silent loadview
|
||||
autocmd BufRead ?* silent! loadview
|
||||
augroup END
|
||||
|
||||
"}}}
|
||||
" Show trailing whitepace and spaces before a tab: {{{
|
||||
augroup whitespaceerrors
|
||||
autocmd!
|
||||
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL
|
||||
augroup END
|
||||
autocmd Syntax * syn match ExtraWhitespace /\s\+$\| \+\ze\t/ containedin=ALL
|
||||
augroup END
|
||||
|
||||
"}}}
|
||||
" automatically reload if color scheme file written {{{
|
||||
|
@ -1254,7 +1254,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
endif"}}}
|
||||
|
||||
" non-empty buftype (help, quickfix, etc) {{{
|
||||
if a:isactive
|
||||
if a:isactive
|
||||
let l:statusline .= l:active . "%{&buftype == '' ? '' : ' '}%q%h%w%#StatusLineActiveNoText#"
|
||||
else
|
||||
let l:statusline .= l:normal . "%{&buftype == '' ? '' : ' '}%q%h%w%#StatusLineNormalNoText#"
|
||||
|
@ -1263,15 +1263,15 @@ function! GetStatus(isactive) abort "{{{
|
|||
"}}}
|
||||
|
||||
" right/left divider {{{
|
||||
let l:statusline.=l:separator
|
||||
" modified version
|
||||
let l:statusline.=l:separator
|
||||
" modified version
|
||||
let l:color = 'StatusLineDivMod' . (a:isactive?'Active':'')
|
||||
let l:statusline .= GetStatusFrag("&modified && mode() != 'i'", l:color, '%<', l:divider)
|
||||
|
||||
|
||||
" unmodified version
|
||||
let l:color = 'StatusLineDiv' . (a:isactive?'Active':'')
|
||||
let l:statusline .= GetStatusFrag("!&modified && mode() != 'i'", l:color, '%<', l:divider)
|
||||
|
||||
|
||||
" input mode version
|
||||
if a:isactive
|
||||
let l:statusline .= GetStatusFrag("mode() == 'i'", 'StatusLineDivInput', '%<', l:divider)
|
||||
|
@ -1281,7 +1281,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
"}}}
|
||||
|
||||
" file info{{{
|
||||
if a:isactive == 1
|
||||
if a:isactive == 1
|
||||
" let l:statusline.=l:active
|
||||
let l:statusline.='%#StatusLineFileInfo#'
|
||||
" let l:statusline.=" %{strlen(&ft)?&ft:'none'} "
|
||||
|
@ -1297,7 +1297,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
"}}}
|
||||
|
||||
" path/filename.extension {{{
|
||||
if a:isactive
|
||||
if a:isactive
|
||||
if &readonly
|
||||
let l:statusline .= '%#StatusLineWarningActive# %r '
|
||||
let l:statusline .= '%#StatusLineFileReadOnlyActive#'
|
||||
|
@ -1341,7 +1341,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
let l:statusline.='%*' . l:separator
|
||||
|
||||
" linter status {{{
|
||||
if a:isactive
|
||||
if a:isactive
|
||||
" errors
|
||||
let l:statusline .= "%#LinterDashActive#%{(GetLinterStatus('error') == 0?'-':'')}"
|
||||
let l:statusline .= "%#LinterErrorActive#%{(GetLinterStatus('error') == 0?'':GetLinterStatus('error'))}"
|
||||
|
@ -1387,7 +1387,7 @@ function! GetStatus(isactive) abort "{{{
|
|||
|
||||
return l:statusline
|
||||
|
||||
endfunction
|
||||
endfunction
|
||||
"}}}
|
||||
|
||||
" highlight groups {{{
|
||||
|
|
Loading…
Reference in New Issue