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
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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, '"', "\\"))

View File

@ -66,7 +66,7 @@ creates a namespace so that custom commands don't interfere with Vim's
built-in shortcuts.
The leader key can be mapped to whatever the user likes (see :help mapleader).
In the definition of custom commands |<Leader>| is the placeholder for the
In the definition of custom commands |<Leader>| is the placeholder for the
leader key. To see the current mapping for |<Leader>| type :echo mapleader.
If it reports an undefined variable it means the leader key is set to the
default of '\'.
@ -464,38 +464,38 @@ change the filetype back: >
|'NERDCustomDelimiters'| Add or override delimiters for any
filetypes.
|'NERDDefaultNesting'| Tells the script to use nested comments
by default.
|'NERDMenuMode'| Specifies how the NERD commenter menu
will appear (if at all).
|'NERDLPlace'| Specifies what to use as the left
delimiter placeholder when nesting
comments.
|'NERDUsePlaceHolders'| Specifies which filetypes may use
placeholders when nesting comments.
|'NERDRemoveAltComs'| Tells the script whether to remove
alternative comment delimiters when
uncommenting.
|'NERDRemoveExtraSpaces'| Tells the script to always remove the
extra spaces when uncommenting
(regardless of whether NERDSpaceDelims
is set).
|'NERDRPlace'| Specifies what to use as the right
delimiter placeholder when nesting
comments.
|'NERDSpaceDelims'| Specifies whether to add extra spaces
around delimiters when commenting, and
whether to remove them when
uncommenting.
|'NERDTrimTrailingWhitespace'| Specifies if trailing whitespace
should be deleted when uncommenting.
@ -506,7 +506,7 @@ change the filetype back: >
one of 'none', 'left', 'start', or
'both'.
|'NERDToggleCheckAllLines'| Enable NERDCommenterToggle to check
|'NERDToggleCheckAllLines'| Enable NERDCommenterToggle to check
all selected lines is commented or not.
------------------------------------------------------------------------------
@ -826,7 +826,7 @@ again.
Values: 0 or 1.
Default 0.
When this option is set to 1, NERDCommenterToggle will check all selected line,
When this option is set to 1, NERDCommenterToggle will check all selected line,
if there have oneline not be commented, then comment all lines.
------------------------------------------------------------------------------
@ -901,15 +901,15 @@ NERDComment({mode}, {type}) *NERDComment()*
{mode}: character indicating the mode in which the comment
is requested:
'n' for Normal mode, 'x' for Visual mode
{type}: the type of commenting requested. Can be 'Sexy',
'Invert', 'Minimal', 'Toggle', 'AlignLeft',
{type}: the type of commenting requested. Can be 'Sexy',
'Invert', 'Minimal', 'Toggle', 'AlignLeft',
'AlignBoth', 'Comment', 'Nested', 'ToEOL', 'Append',
'Insert', 'Uncomment', 'Yank'
NERDCommentIsCharCommented({line}, {col}) *NERDCommentIsCharCommented()*
Check if the character at [{line}, {col}] is inside a comment
Note the Comment delimeter it self is considered as part of the
Note the Comment delimeter it self is considered as part of the
comment
Args: