From c5a72103bf443e22351771695a6e12dfbe22f2f6 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 22 Jan 2019 17:50:34 +0100 Subject: [PATCH] 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 --- src/nano.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nano.c b/src/nano.c index ec0bb038..accd878e 100644 --- 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);