address issues #82, #83, #84 (#85)

* address issues #82, #83, #84

* address code review issues

* remove fzf autocmd per code review comments
This commit is contained in:
Derek Sifford 2018-05-23 22:52:06 -04:00 committed by GitHub
parent c01ceb9a84
commit b5548cd0af
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
16 changed files with 31 additions and 22 deletions

View file

@ -1,3 +1,7 @@
if dracula#should_abort()
finish
endif
" Fzf: {{{ " Fzf: {{{
if exists('g:loaded_fzf') && ! exists('g:fzf_colors') if exists('g:loaded_fzf') && ! exists('g:fzf_colors')
let g:fzf_colors = { let g:fzf_colors = {
@ -14,16 +18,12 @@ if exists('g:loaded_fzf') && ! exists('g:fzf_colors')
\ 'marker': ['fg', 'Keyword'], \ 'marker': ['fg', 'Keyword'],
\ 'spinner': ['fg', 'Label'], \ 'spinner': ['fg', 'Label'],
\ 'header': ['fg', 'Comment'] } \ 'header': ['fg', 'Comment'] }
augroup dracula_fzf
autocmd!
autocmd FileType fzf set laststatus=0 noshowmode noruler
\| autocmd BufLeave <buffer> set laststatus=2 showmode ruler
augroup END
endif endif
"}}} "}}}
" GitGutter: {{{ " GitGutter: {{{
" FIXME: This can be removed once airblade/vim-gitgutter#520 closes
" see: https://github.com/airblade/vim-gitgutter/issues/520#issuecomment-389931281
if exists('g:gitgutter_enabled') if exists('g:gitgutter_enabled')
hi! link GitGutterAdd DraculaGreen hi! link GitGutterAdd DraculaGreen
hi! link GitGutterChange DraculaYellow hi! link GitGutterChange DraculaYellow

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'css' if dracula#should_abort('css')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'gitcommit' if dracula#should_abort('gitcommit')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'html' if dracula#should_abort('html')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'javascript' if dracula#should_abort('javascript')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') if dracula#should_abort('markdown', 'mkd')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'ocaml' if dracula#should_abort('ocaml')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'php' if dracula#should_abort('php')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'ruby' if dracula#should_abort('ruby')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'sass' if dracula#should_abort('sass')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'typescript' if dracula#should_abort('typescript')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'typescriptreact' if dracula#should_abort('typescriptreact')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'vim' if dracula#should_abort('vim')
finish finish
endif endif

View file

@ -1,4 +1,4 @@
if ! exists('b:current_syntax') || b:current_syntax !=# 'yaml' if dracula#should_abort('yaml')
finish finish
endif endif

10
autoload/dracula.vim Normal file
View file

@ -0,0 +1,10 @@
" Helper function that takes a variadic list of filetypes as args and returns
" whether or not the execution of the ftplugin should be aborted.
func! dracula#should_abort(...)
if ! exists('g:colors_name') || g:colors_name !=# 'dracula'
return 1
elseif a:0 > 0 && (! exists('b:current_syntax') || index(a:000, b:current_syntax) == -1)
return 1
endif
return 0
endfunction

View file

@ -210,8 +210,7 @@ call s:h('DraculaRedInverse', s:fg, s:red)
call s:h('DraculaYellow', s:yellow) call s:h('DraculaYellow', s:yellow)
call s:h('DraculaYellowItalic', s:yellow, s:none, [s:attrs.italic]) call s:h('DraculaYellowItalic', s:yellow, s:none, [s:attrs.italic])
call s:h('DraculaError', s:red, s:none, [s:attrs.undercurl], s:red) call s:h('DraculaError', s:red, s:none, [], s:red)
call s:h('DraculaWarn', s:orange, s:none, [s:attrs.undercurl], s:orange)
call s:h('DraculaErrorLine', s:none, s:none, [s:attrs.undercurl], s:red) call s:h('DraculaErrorLine', s:none, s:none, [s:attrs.undercurl], s:red)
call s:h('DraculaWarnLine', s:none, s:none, [s:attrs.undercurl], s:orange) call s:h('DraculaWarnLine', s:none, s:none, [s:attrs.undercurl], s:orange)