You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 lines
469 B

" A small plugin to fold if err nil statements that do nothing except for
" propagating errors
" License: Unlicense
if exists('g:loaded_gofoldiferrnil') | finish | endif " prevent loading file twice
if !has('nvim-0.5')
echoerr 'You need neovim 0.5 or newer to run this plugin'
let s:save_cpo = &cpo
set cpo&vim
command! GoFoldIfErr lua require('fold_if_err_nil').foldIfErrNills()
let &cpo = s:save_cpo
unlet s:save_cpo
let g:loaded_whid = 1