[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] startup: allow using a bare "+" to mean put-cursor-on-last-line
From: |
Benno Schulenberg |
Subject: |
[PATCH] startup: allow using a bare "+" to mean put-cursor-on-last-line |
Date: |
Mon, 24 May 2021 16:34:52 +0200 |
Editors like 'vim' and 'ne' and 'uemacs' know this shorthand too.
This fulfills https://savannah.gnu.org/bugs/?60663.
---
src/nano.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/nano.c b/src/nano.c
index 232ad92a..a4a9c3d1 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2403,7 +2403,11 @@ int main(int argc, char **argv)
optind++;
} else
#endif
- if (!parse_line_column(&argv[optind++][n], &givenline,
&givencol))
+ /* When there is nothing after the "+", understand it
as go-to-EOF,
+ * otherwise parse and store the given number(s).*/
+ if (argv[optind++][1] == '\0')
+ givenline = -1;
+ else if (!parse_line_column(&argv[optind - 1][1],
&givenline, &givencol))
statusline(ALERT, _("Invalid line or column
number"));
}
--
2.29.3
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] startup: allow using a bare "+" to mean put-cursor-on-last-line,
Benno Schulenberg <=