commit c5a72103bf443e22351771695a6e12dfbe22f2f6
parent da4b7e430f2ff5704db55fbe3b94236daca4eb19
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 22 Jan 2019 17:50:34 +0100
justify: extend the quoting regex, to cover more types of comments
Now also comment blocks in Fortran, Lisp, Lua, Postgres, and TeX
can be rewrapped with ^J.
This partially addresses https://savannah.gnu.org/bugs/?55435.
Kind-of-requested-by: David Griffith <dave@661.org>
Diffstat:
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/nano.c b/src/nano.c
@@ -2468,7 +2468,7 @@ int main(int argc, char **argv)
if (brackets == NULL)
brackets = mallocstrcpy(NULL, "\"')>]}");
if (quotestr == NULL)
- quotestr = mallocstrcpy(NULL, "^([ \t]*([#:>|}]|/{2}))+");
+ quotestr = mallocstrcpy(NULL, "^([ \t]*([!#%:;>|}]|/{2}|--))+");
/* Compile the quoting regex, and exit when it's invalid. */
quoterc = regcomp("ereg, quotestr, NANO_REG_EXTENDED);