mirror of
https://github.com/chenasraf/vim-matchup.git
synced 2026-05-18 01:38:57 +00:00
Fix various lints
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
let s:save_cpo = &cpo
|
||||
set cpo&vim
|
||||
|
||||
function! matchup#init()
|
||||
function! matchup#init() abort
|
||||
call matchup#perf#tic('loading')
|
||||
|
||||
call s:init_options()
|
||||
@@ -293,7 +293,7 @@ function! s:snr()
|
||||
endfunction
|
||||
let s:sid = printf("\<SNR>%d_", s:snr())
|
||||
|
||||
function! matchup#motion_sid()
|
||||
function! matchup#motion_sid() abort
|
||||
return s:sid
|
||||
endfunction
|
||||
|
||||
|
||||
@@ -73,7 +73,7 @@ endfunction
|
||||
" [@opts] user data dict passed to function
|
||||
function! matchup#custom#define_motion(modes, keys, fcn, ...) abort
|
||||
if a:modes !~# '^[nox]\+$'
|
||||
echoerr "invalid modes"
|
||||
echoerr 'invalid modes'
|
||||
endif
|
||||
|
||||
let s:custom_counter += 1
|
||||
|
||||
@@ -381,7 +381,7 @@ function! s:get_delim(opts) abort " {{{1
|
||||
let l:check_skip = get(a:opts, 'check_skip',
|
||||
\ g:matchup_delim_noskips >= 2
|
||||
\ || g:matchup_delim_noskips >= 1
|
||||
\ && getline(line('.'))[l:cursorpos-1] =~ '[^[:punct:]]')
|
||||
\ && getline(line('.'))[l:cursorpos-1] =~? '[^[:punct:]]')
|
||||
if l:check_skip && matchup#delim#skip(line('.'), l:cursorpos)
|
||||
return {}
|
||||
endif
|
||||
@@ -440,7 +440,7 @@ function! s:get_delim(opts) abort " {{{1
|
||||
" in 'current' mode, but be explicit
|
||||
if a:opts.direction !=# 'current'
|
||||
\ && (l:check_skip || g:matchup_delim_noskips == 1
|
||||
\ && getline(l:lnum)[l:cnum-1] =~ '[^[:punct:]]')
|
||||
\ && getline(l:lnum)[l:cnum-1] =~? '[^[:punct:]]')
|
||||
\ && matchup#delim#skip(l:lnum, l:cnum)
|
||||
\ && (a:opts.direction ==# 'prev' ? (l:lnum > 1 || l:cnum > 1)
|
||||
\ : (l:lnum < line('$') || l:cnum < len(getline('$'))))
|
||||
|
||||
@@ -75,6 +75,7 @@ function! matchup#loader#refresh_match_words() abort " {{{1
|
||||
|
||||
" protect the cursor from the match_words function
|
||||
let l:save_pos = matchup#pos#get_cursor()
|
||||
let l:match_words = ''
|
||||
execute 'let l:match_words = ' b:match_words
|
||||
if l:save_pos != matchup#pos#get_cursor()
|
||||
call matchup#pos#set_cursor(l:save_pos)
|
||||
|
||||
@@ -68,8 +68,10 @@ function! matchup#text_obj#delimited(is_inner, visual, type) " {{{1
|
||||
call feedkeys("\<c-\>\<c-n>\<esc>", 'n')
|
||||
|
||||
" and undo the text vim enters if necessary
|
||||
" vint: -ProhibitUnnecessaryDoubleQuote
|
||||
call feedkeys(":call matchup#text_obj#undo("
|
||||
\ .undotree().seq_cur.")\<cr>:\<c-c>", 'n')
|
||||
" vint: +ProhibitUnnecessaryDoubleQuote
|
||||
endif
|
||||
return
|
||||
endif
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
if !exists('g:loaded_matchup')
|
||||
\ || !exists('g:loaded_matchit')
|
||||
\ || !exists(":MatchDebug")
|
||||
\ || !exists(':MatchDebug')
|
||||
finish
|
||||
endif
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ set cpo&vim
|
||||
function! matchup#util#command(cmd) " {{{1
|
||||
let l:lines = ''
|
||||
try
|
||||
silent! redir => l:lines
|
||||
execute 'silent! redir => l:lines'
|
||||
silent! execute a:cmd
|
||||
redir END
|
||||
finally
|
||||
|
||||
@@ -115,8 +115,8 @@ endfunction
|
||||
|
||||
function! matchup#where#print(args)
|
||||
let l:verbose = 0
|
||||
if a:args =~ '!' || len(a:args) >= 2
|
||||
\ || a:args =~ '?' && s:curpos == getcurpos()
|
||||
if a:args =~? '!' || len(a:args) >= 2
|
||||
\ || a:args =~? '?' && s:curpos == getcurpos()
|
||||
let l:verbose = 1
|
||||
endif
|
||||
let s:curpos = getcurpos()
|
||||
|
||||
Reference in New Issue
Block a user