Letting +1 and +,1 make nano start on line one column one, overriding

a position from history.  This fixes Savannah bug #42538.


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5003 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
This commit is contained in:
Benno Schulenberg 2014-06-20 19:10:24 +00:00
parent b14fbf719f
commit 3060ce36d3
2 changed files with 7 additions and 7 deletions

View File

@ -15,6 +15,8 @@
* src/nano.c: Fix compilation with --enable-tiny --enable-mouse. * src/nano.c: Fix compilation with --enable-tiny --enable-mouse.
* doc/man/nanorc.5, doc/texinfo/nano.texi: Explain better what "all" * doc/man/nanorc.5, doc/texinfo/nano.texi: Explain better what "all"
means when rebinding keys. This is a fix for Savannah bug #42552. means when rebinding keys. This is a fix for Savannah bug #42552.
* src/nano.c (main): Make +1 and +,1 start on line one column one,
overriding a historical position. This fixes Savannah bug #42538.
2014-06-19 Benno Schulenberg <bensberg@justemail.net> 2014-06-19 Benno Schulenberg <bensberg@justemail.net>
* src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()' * src/nano.c (window_init): Rename 'no_more_space()' to 'more_space()'

View File

@ -2102,10 +2102,8 @@ void do_output(char *output, size_t output_len, bool allow_cntrls)
int main(int argc, char **argv) int main(int argc, char **argv)
{ {
int optchr; int optchr;
ssize_t startline = 1; ssize_t startline = 0, startcol = 0;
/* Line to try and start at. */ /* Target line and column when specified on the command line. */
ssize_t startcol = 1;
/* Column to try and start at. */
#ifndef DISABLE_WRAPJUSTIFY #ifndef DISABLE_WRAPJUSTIFY
bool fill_used = FALSE; bool fill_used = FALSE;
/* Was the fill option used? */ /* Was the fill option used? */
@ -2716,7 +2714,7 @@ int main(int argc, char **argv)
* new buffers. */ * new buffers. */
{ {
int i = optind + 1; int i = optind + 1;
ssize_t iline = 1, icol = 1; ssize_t iline = 0, icol = 0;
for (; i < argc; i++) { for (; i < argc; i++) {
/* If there's a +LINE or +LINE,COLUMN flag here, it is /* If there's a +LINE or +LINE,COLUMN flag here, it is
@ -2728,7 +2726,7 @@ int main(int argc, char **argv)
else { else {
open_buffer(argv[i], FALSE); open_buffer(argv[i], FALSE);
if (iline > 1 || icol > 1) { if (iline > 0 || icol > 0) {
do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE, do_gotolinecolumn(iline, icol, FALSE, FALSE, FALSE,
FALSE); FALSE);
iline = 1; iline = 1;
@ -2778,7 +2776,7 @@ int main(int argc, char **argv)
precalc_multicolorinfo(); precalc_multicolorinfo();
#endif #endif
if (startline > 1 || startcol > 1) if (startline > 0 || startcol > 0)
do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE, do_gotolinecolumn(startline, startcol, FALSE, FALSE, FALSE,
FALSE); FALSE);
#ifndef DISABLE_HISTORIES #ifndef DISABLE_HISTORIES