mirror of
https://github.com/nix-community/nixvim.git
synced 2025-06-23 17:28:39 +02:00
plugins/todo-comments: fix missing mkRaw for pattern options (#242)
This commit is contained in:
parent
933c87c282
commit
8fed61902a
2 changed files with 27 additions and 8 deletions
|
@ -114,8 +114,14 @@ in {
|
||||||
"fg" or "bg" or empty.
|
"fg" or "bg" or empty.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
pattern = helpers.mkNullOrOption (with types; either str (listOf str)) ''
|
pattern =
|
||||||
|
helpers.defaultNullOpts.mkNullable
|
||||||
|
(with types; either str (listOf str))
|
||||||
|
".*<(KEYWORDS)\\s*:"
|
||||||
|
''
|
||||||
Pattern or list of patterns, used for highlighting (vim regex)
|
Pattern or list of patterns, used for highlighting (vim regex)
|
||||||
|
|
||||||
|
Note: the provided pattern will be embedded as such: `[[PATTERN]]`.
|
||||||
'';
|
'';
|
||||||
|
|
||||||
commentsOnly = helpers.defaultNullOpts.mkBool true ''
|
commentsOnly = helpers.defaultNullOpts.mkBool true ''
|
||||||
|
@ -168,9 +174,11 @@ in {
|
||||||
```
|
```
|
||||||
'';
|
'';
|
||||||
|
|
||||||
pattern = helpers.defaultNullOpts.mkStr "[[\b(KEYWORDS):]]" ''
|
pattern = helpers.defaultNullOpts.mkStr "\\b(KEYWORDS):" ''
|
||||||
Regex that will be used to match keywords.
|
Regex that will be used to match keywords.
|
||||||
Don't replace the (KEYWORDS) placeholder.
|
Don't replace the (KEYWORDS) placeholder.
|
||||||
|
|
||||||
|
Note: the provided pattern will be embedded as such: `[[PATTERN]]`.
|
||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -226,16 +234,27 @@ in {
|
||||||
before
|
before
|
||||||
keyword
|
keyword
|
||||||
after
|
after
|
||||||
pattern
|
|
||||||
exclude
|
exclude
|
||||||
;
|
;
|
||||||
|
pattern =
|
||||||
|
helpers.ifNonNull' cfg.highlight.pattern
|
||||||
|
(helpers.mkRaw "[[${cfg.highlight.pattern}]]");
|
||||||
multiline_pattern = cfg.highlight.multilinePattern;
|
multiline_pattern = cfg.highlight.multilinePattern;
|
||||||
multiline_context = cfg.highlight.multilineContext;
|
multiline_context = cfg.highlight.multilineContext;
|
||||||
comments_only = cfg.highlight.commentsOnly;
|
comments_only = cfg.highlight.commentsOnly;
|
||||||
max_line_len = cfg.highlight.maxLineLen;
|
max_line_len = cfg.highlight.maxLineLen;
|
||||||
};
|
};
|
||||||
colors = cfg.colors;
|
colors = cfg.colors;
|
||||||
search = cfg.search;
|
search = helpers.ifNonNull' cfg.search {
|
||||||
|
inherit (cfg.search) command args;
|
||||||
|
pattern =
|
||||||
|
helpers.ifNonNull' cfg.search.pattern
|
||||||
|
(
|
||||||
|
if isList cfg.search.pattern
|
||||||
|
then (map (p: helpers.mkRaw p) cfg.search.pattern)
|
||||||
|
else helpers.mkRaw "[[${cfg.search.pattern}]]"
|
||||||
|
);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
// cfg.extraOptions;
|
// cfg.extraOptions;
|
||||||
in
|
in
|
||||||
|
|
|
@ -62,7 +62,7 @@
|
||||||
before = "";
|
before = "";
|
||||||
keyword = "wide";
|
keyword = "wide";
|
||||||
after = "fg";
|
after = "fg";
|
||||||
pattern = "[[.*<(KEYWORDS)\s*:]]";
|
pattern = ''.*<(KEYWORDS)\s*:'';
|
||||||
commentsOnly = true;
|
commentsOnly = true;
|
||||||
maxLineLen = 400;
|
maxLineLen = 400;
|
||||||
exclude = [];
|
exclude = [];
|
||||||
|
@ -86,7 +86,7 @@
|
||||||
"--line-number"
|
"--line-number"
|
||||||
"--column"
|
"--column"
|
||||||
];
|
];
|
||||||
pattern = "[[\b(KEYWORDS):]]";
|
pattern = ''\b(KEYWORDS):'';
|
||||||
};
|
};
|
||||||
|
|
||||||
keymapsSilent = true;
|
keymapsSilent = true;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue