@@ -141,27 +141,27 @@ CommentConfig *comment.config.CommentConfig*
141141 Plugin's configuration
142142
143143 Fields: ~
144- {padding} (boolean|fun():boolean) Controls space between the comment
145- and the line (default: 'true' )
146- {sticky} (boolean) Whether cursor should stay at the
147- same position. Only works in NORMAL
148- mode mappings (default: 'true' )
149- {ignore} (string|fun():string) Lua pattern used to ignore lines
150- during (un)comment (default: 'nil' )
151- {mappings} (Mappings| false) Enables | comment.keybindings|
152- NOTE: If given 'false' , then the
153- plugin won't create any mappings
154- {toggler} (Toggler)
155- {opleader} (Opleader)
156- {extra} (ExtraMapping)
157- {pre_hook} (fun(ctx ):string) Function to call before (un)comment.
158- It is called with a {ctx} argument
159- of type | comment.utils.CommentCtx |
160- (default: 'nil' )
161- {post_hook} (fun(ctx)) Function to call after (un)comment.
162- It is called with a {ctx} argument
163- of type | comment.utils.CommentCtx |
164- (default: 'nil' )
144+ {padding} (boolean|fun():boolean) Controls space between the comment
145+ and the line (default: 'true' )
146+ {sticky} (boolean) Whether cursor should stay at the
147+ same position. Only works in NORMAL
148+ mode mappings (default: 'true' )
149+ {ignore} (string|fun():string) Lua pattern used to ignore lines
150+ during (un)comment (default: 'nil' )
151+ {mappings} (Mappings| false) Enables | comment.keybindings|
152+ NOTE: If given 'false' , then the
153+ plugin won't create any mappings
154+ {toggler} (Toggler) See | comment.config.Toggler |
155+ {opleader} (Opleader) See | comment.config.Opleader |
156+ {extra} (ExtraMapping) See | comment.config.ExtraMapping |
157+ {pre_hook} (fun(c:CommentCtx ):string) Function to call before (un)comment.
158+ It is called with a {ctx} argument
159+ of type | comment.utils.CommentCtx |
160+ (default: 'nil' )
161+ {post_hook} (fun(c:CommentCtx)) Function to call after (un)comment.
162+ It is called with a {ctx} argument
163+ of type | comment.utils.CommentCtx |
164+ (default: 'nil' )
165165
166166
167167Mappings *comment.config.Mappings*
@@ -321,8 +321,9 @@ api.toggle *comment.api.toggle*
321321 Usage: ~
322322 >
323323 local api = require('Comment.api')
324+ local config = require('Comment.config'):get()
324325
325- api.toggle.linewise(motion, config)
326+ api.toggle.linewise(motion, config? )
326327 api.toggle.linewise.current(motion?, config?)
327328 api.toggle.linewise.count(count, config?)
328329
@@ -387,8 +388,9 @@ api.comment *comment.api.comment*
387388 Usage: ~
388389 >
389390 local api = require('Comment.api')
391+ local config = require('Comment.config'):get()
390392
391- api.comment.linewise(motion, config)
393+ api.comment.linewise(motion, config? )
392394 api.comment.linewise.current(motion?, config?)
393395 api.comment.linewise.count(count, config?)
394396
@@ -417,8 +419,9 @@ api.uncomment *comment.api.uncomment*
417419 Usage: ~
418420 >
419421 local api = require('Comment.api')
422+ local config = require('Comment.config'):get()
420423
421- api.uncomment.linewise(motion, config)
424+ api.uncomment.linewise(motion, config? )
422425 api.uncomment.linewise.current(motion?, config?)
423426 api.uncomment.linewise.count(count, config?)
424427
@@ -441,14 +444,15 @@ api.insert *comment.api.insert*
441444 Usage: ~
442445 >
443446 local api = require('Comment.api')
447+ local config = require('Comment.config'):get()
444448
445- api.insert.linewise.above(cfg ?)
446- api.insert.linewise.below(cfg ?)
447- api.insert.linewise.eol(cfg ?)
449+ api.insert.linewise.above(config ?)
450+ api.insert.linewise.below(config ?)
451+ api.insert.linewise.eol(config ?)
448452
449- api.insert.blockwise.above(cfg ?)
450- api.insert.blockwise.below(cfg ?)
451- api.insert.blockwise.eol(cfg ?)
453+ api.insert.blockwise.above(config ?)
454+ api.insert.blockwise.below(config ?)
455+ api.insert.blockwise.eol(config ?)
452456 <
453457
454458
@@ -496,7 +500,7 @@ api.call({cb}, {op}) *comment.api.call*
496500
497501 Parameters: ~
498502 {cb} (string) Name of the API function to call
499- {op} ('g@'|' g@$' ) Operator string to execute
503+ {op} ("g@"|" g@$" ) Operator-mode expression
500504
501505 Returns: ~
502506 {fun():string} Keymap RHS callback
@@ -776,7 +780,7 @@ U.commenter({left}, {right}, {padding}, {scol?}, {ecol?}, {tabbed?})
776780 {tabbed?} (boolean) Using tab indentation
777781
778782 Returns: ~
779- {fun(line:string|string[]):string}
783+ {fun(line:string| string[]):string | string[] }
780784
781785
782786 *comment.utils.uncommenter*
@@ -794,7 +798,7 @@ U.uncommenter({left}, {right}, {padding}, {scol?}, {ecol?})
794798 {ecol?} (integer) Ending column
795799
796800 Returns: ~
797- {fun(line:string|string[]):string}
801+ {fun(line:string| string[]):string | string[] }
798802
799803
800804 *comment.utils.is_commented*
0 commit comments