mirror of
https://github.com/preservim/nerdcommenter.git
synced 2025-11-13 12:13:47 -05:00
style: Remove stray whitespaces & normalize format (#517)
This commit is contained in:
@@ -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, '"', "\\"))
|
||||
|
||||
Reference in New Issue
Block a user