style: Remove stray whitespaces & normalize format (#517)

This commit is contained in:
YuyaKoda
2023-04-27 00:20:01 +09:00
committed by GitHub
parent e23f55e735
commit 1fe9e1cfea
2 changed files with 27 additions and 27 deletions

View File

@@ -1309,7 +1309,7 @@ endfunction
" Function: nerdcommenter#IsCharCommented(line, col) abort
" Check if the character at [line, col] is inside a comment
" Note the Comment delimeter it self is considered as part of the comment
"
"
" Args:
" -line the line number of the character
" -col the column number of the character
@@ -1317,7 +1317,7 @@ endfunction
function! nerdcommenter#IsCharCommented(line, col) abort
" Function: s:searchfor(str, line, col, direction, [maxline])
" search str in the buffer, including the character at [line, col]
" Args:
" Args:
" -str: the string for search
" -line: the line number where search begins
" -col: the column number where search begins
@@ -1385,14 +1385,14 @@ function! nerdcommenter#IsCharCommented(line, col) abort
let leftpos = s:searchfor(a:left, a:line, a:col, 1)
if leftpos == [0, 0]
if !blockcommented | let blockcommented = 0 | endif
else
else
" call s:searchfor(a:right, a:line, a:col, 0)
let rightpos = s:searchfor(a:right, leftpos[0], leftpos[1] + strlen(a:right) + 1, 0)
if rightpos != [0, 0]
if rightpos[0] < a:line
if !blockcommented | let blockcommented = 0 | endif
elseif rightpos[0] == a:line
if !blockcommented
if !blockcommented
let blockcommented = (rightpos[1] + strlen(a:right) > a:col) ? 1 : 0
endif
else " rightpos > a:line
@@ -1406,14 +1406,14 @@ function! nerdcommenter#IsCharCommented(line, col) abort
return linecommented || blockcommented
endfunction
return s:checkwith(
\ b:NERDCommenterDelims['left'],
\ b:NERDCommenterDelims['right'],
\ a:line,
\ a:col) ||
\ b:NERDCommenterDelims['left'],
\ b:NERDCommenterDelims['right'],
\ a:line,
\ a:col) ||
\ s:checkwith(
\ b:NERDCommenterDelims['leftAlt'],
\ b:NERDCommenterDelims['rightAlt'],
\ a:line,
\ b:NERDCommenterDelims['leftAlt'],
\ b:NERDCommenterDelims['rightAlt'],
\ a:line,
\ a:col)
endfunction
@@ -2528,7 +2528,7 @@ function! s:IsDelimValid(delimiter, delIndx, line) abort
"vim comments are so fucking stupid!! Why the hell do they have comment
"delimiters that are used elsewhere in the syntax?!?! We need to check
"some conditions especially for vim.
"some conditions especially for vim.
"Also check &commentstring because it may be overwritten for embedded lua.
if &filetype ==# 'vim' && &commentstring[0] ==# '"'
if !s:IsNumEven(s:CountNonESCedOccurances(preComStr, '"', "\\"))