Skip to content

Commit

Permalink
chore: format
Browse files Browse the repository at this point in the history
  • Loading branch information
ponkio-o committed Apr 26, 2023
1 parent e23f55e commit b87948d
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 27 deletions.
24 changes: 12 additions & 12 deletions autoload/nerdcommenter.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1309,15 +1309,15 @@ 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
" Return: Number, 1 if the character is inside a comment, 0 if is not
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
Expand Down Expand Up @@ -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
Expand All @@ -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

Expand Down Expand Up @@ -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, '"', "\\"))
Expand Down
30 changes: 15 additions & 15 deletions doc/nerdcommenter.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 '\'.
Expand Down Expand Up @@ -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.

Expand All @@ -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.

------------------------------------------------------------------------------
Expand Down Expand Up @@ -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.

------------------------------------------------------------------------------
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit b87948d

Please sign in to comment.