[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Nano-devel] [PATCH 04/15] options: add -e, --emptyline, the counterpart
From: |
Benno Schulenberg |
Subject: |
[Nano-devel] [PATCH 04/15] options: add -e, --emptyline, the counterpart of --morespace |
Date: |
Thu, 31 Jan 2019 17:49:30 +0100 |
---
src/nano.c | 15 ++++++++++++---
src/nano.h | 3 ++-
2 files changed, 14 insertions(+), 4 deletions(-)
diff --git a/src/nano.c b/src/nano.c
index 12ab1c07..accaf2d4 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -808,7 +808,6 @@ void usage(void)
print_opt("-N", "--noconvert",
N_("Don't convert files from DOS/Mac
format"));
#endif
- print_opt("-O", "--morespace", N_("Use one more line for editing"));
#ifdef ENABLE_HISTORIES
if (!ISSET(RESTRICTED))
print_opt("-P", "--positionlog",
@@ -845,6 +844,7 @@ void usage(void)
print_opt("-c", "--constantshow", N_("Constantly show cursor
position"));
print_opt("-d", "--rebinddelete",
N_("Fix Backspace/Delete confusion
problem"));
+ print_opt("-e", "--emptyline", N_("Keep the line below the title bar
empty"));
print_opt("-f", "--finalnewline", N_("Ensure that text ends with a
newline"));
#ifdef ENABLE_BROWSER
if (!ISSET(RESTRICTED))
@@ -1975,6 +1975,7 @@ int main(int argc, char **argv)
#endif
{"constantshow", 0, NULL, 'c'},
{"rebinddelete", 0, NULL, 'd'},
+ {"emptyline", 0, NULL, 'e'},
{"finalnewline", 0, NULL, 'f'},
#ifdef ENABLE_BROWSER
{"showcursor", 0, NULL, 'g'},
@@ -2082,7 +2083,7 @@ int main(int argc, char **argv)
while ((optchr =
getopt_long(argc, argv,
-
"ABC:DEFGHIKLMNOPQ:RST:UVWX:Y:Zabcdfghijklmno:pr:s:tuvwxyz$",
+
"ABC:DEFGHIKLMNOPQ:RST:UVWX:Y:Zabcdefghijklmno:pr:s:tuvwxyz$",
long_options, NULL)) != -1) {
switch (optchr) {
#ifndef NANO_TINY
@@ -2141,7 +2142,7 @@ int main(int argc, char **argv)
break;
#endif
case 'O':
- SET(MORE_SPACE);
+ UNSET(EMPTY_LINE);
break;
#ifdef ENABLE_HISTORIES
case 'P':
@@ -2206,6 +2207,9 @@ int main(int argc, char **argv)
case 'd':
SET(REBIND_DELETE);
break;
+ case 'e':
+ SET(EMPTY_LINE);
+ break;
case 'f':
SET(FINAL_NEWLINE);
break;
@@ -2418,6 +2422,11 @@ int main(int argc, char **argv)
else
SET(SMOOTH_SCROLL);
+ if (ISSET(EMPTY_LINE))
+ UNSET(MORE_SPACE);
+ else
+ SET(MORE_SPACE);
+
/* If the user wants bold instead of reverse video for hilited text...
*/
if (ISSET(BOLD_TEXT))
hilite_attribute = A_BOLD;
diff --git a/src/nano.h b/src/nano.h
index 5b4afa9d..99c01557 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -543,7 +543,8 @@ enum
LET_THEM_ZAP,
BREAK_LONG_LINES,
FINAL_NEWLINE,
- JUMPY_SCROLLING
+ JUMPY_SCROLLING,
+ EMPTY_LINE
};
/* Flags for the menus in which a given function should be present. */
--
2.19.2
- [Nano-devel] [PATCH 01/15] options: add -b, --breaklonglines, the counterpart of --nowrap, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 02/15] options: add -f, --finalnewline, the counterpart of --nonewlines, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 03/15] options: add -j, --jumpyscrolling, the counterpart of --smooth, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 04/15] options: add -e, --emptyline, the counterpart of --morespace,
Benno Schulenberg <=
- [Nano-devel] [PATCH 05/15] rcfile: add the options that correspond to -b, -f, -j, and -e, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 06/15] options: when a nanorc unsets an old flag, set the corresponding new flag, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 07/15] options: let --fill no longer imply automatic hard-wrapping, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 08/15] docs: stop saying that --fill switches on automatic hard-wrapping, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 09/15] docs: describe the four new options (-b, -f, -j, -e) [*incomplete*], Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 10/15] options: warn when -L, -O, -S, or -w are given, and ignore them, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 11/15] tweaks: switch from referencing NO_WRAP to referencing BREAK_LONG_LINES, Benno Schulenberg, 2019/01/31
- [Nano-devel] [PATCH 12/15] tweaks: switch from referencing NO_NEWLINES to referencing FINAL_NEWLINE, Benno Schulenberg, 2019/01/31
- Prev by Date:
[Nano-devel] [PATCH 03/15] options: add -j, --jumpyscrolling, the counterpart of --smooth
- Next by Date:
[Nano-devel] [PATCH 05/15] rcfile: add the options that correspond to -b, -f, -j, and -e
- Previous by thread:
[Nano-devel] [PATCH 03/15] options: add -j, --jumpyscrolling, the counterpart of --smooth
- Next by thread:
[Nano-devel] [PATCH 05/15] rcfile: add the options that correspond to -b, -f, -j, and -e
- Index(es):