14 Commits

Author SHA1 Message Date
Ingo Karkat ad22670338 FIX: ingo#comments#SplitAll(): isBlankRequired is missing from the returned List when there's no comment 2019-06-05 17:53:18 +02:00
Ingo Karkat 8fca1c4263 BUG: Regression: s:GetSplitIndentPattern(): Must not capture group for indent any longer (after 1b4638add7)
Capturing was moved out of this method, but in the no-comment case, this was forgotten.
2019-02-15 14:39:41 +01:00
Ingo Karkat 00d6230b9b ingo#comments#GetSplitIndentPattern(): Add a:minNumberOfCommentPrefixesExpr argument
To allow clients to influence the number of comment prefix matches; especially when passing a line range for comment detection, the comments may not appear uniformly or at all.
2019-01-23 17:31:48 +01:00
Ingo Karkat 1b4638add7 Add ingo#comments#GetSplitIndentPattern() variant of ingo#comments#SplitIndentAndText() that just returns the pattern
Now actually just return the pattern for the indent (+ comment prefix), without capture groups and a full match for the remaining text. This is what clients actually need.
2019-01-23 16:13:57 +01:00
Ingo Karkat be1c1214a9 Add ingo#comments#GetSplitIndentAndTextPattern() variant of ingo#comments#SplitIndentAndText() that just returns the pattern 2019-01-23 13:06:27 +01:00
Ingo Karkat f20bbed1d1 Cosmetics: Delete changelog 2019-01-23 12:35:43 +01:00
Ingo Karkat 45bff3fd45 Refactoring: Factor out s:GetSplitIndentAndTextPattern() 2019-01-23 12:34:05 +01:00
Ingo Karkat aff2fce2b8 BUG: ingo#comments#SplitIndentAndText() and ingo#comments#RemoveCommentPrefix() fail with nestable comment prefixes with "E688: More targets than List items"
Implementation in s:SplitIndentAndText() was based on unnestable prefixes. Instead of adding 1 to the actual nesting level to obtain the pattern multiplier, ensure it is at least 1.
2017-06-27 12:48:17 +02:00
Ingo Karkat d852d61f81 Add ingo#comments#SplitAll(), a more powerful variant of ingo#comments#SplitIndentAndText() 2017-05-26 17:53:31 +02:00
Ingo Karkat bea1b182d3 CHG: ingo#comments#RemoveCommentPrefix() isn't useful as it omits any indent before the comment prefix
Change its implementation to just erase the prefix itself.
Add ingo#comments#SplitIndentAndText() to provide what ingo#comments#RemoveCommentPrefix() was previously used to: The line broken into indent (before, after, and with the comment prefix), and the remaining text.
FIX: Wrong negation in a:options.isIgnoreIndent documentation.
2017-05-26 17:53:26 +02:00
Ingo Karkat 466245a353 2017-05-26 17:51:05 +02:00
Ingo Karkat 2293e63073 CHG: ingo/comments.vim
CHG: Make a:isIgnoreIndent flag to ingo#comments#CheckComment() optional and add a:isStripNonEssentialWhiteSpaceFromCommentString, which is also on by default for DWIM
CHG: Don't strip whitespace in ingo#comments#RemoveCommentPrefix(); with the changed ingo#comments#CheckComment() default behavior, this isn't necessary, and is unexpected.
2017-05-26 17:25:58 +02:00
Ingo Karkat 8291be1639 Move to ingo-library 2017-05-26 17:25:50 +02:00
Ingo Karkat a9b8aec5c0 file creation 2017-05-26 17:03:17 +02:00