]> git.wh0rd.org Git - nano.git/commitdiff
Add in rcfile support for undo since it would be bad to overly punish the masochists...
authorChris Allegretta <chrisa@asty.org>
Sun, 12 Jul 2009 06:13:36 +0000 (06:13 +0000)
committerChris Allegretta <chrisa@asty.org>
Sun, 12 Jul 2009 06:13:36 +0000 (06:13 +0000)
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@4396 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

doc/man/nanorc.5
src/rcfile.c

index 31fdf44e36fe1e42bd5267607ce47c981522e620..73e7d9721fb71376a0db142dddd4e71196aa537c 100644 (file)
@@ -202,6 +202,9 @@ Convert typed tabs to spaces.
 .B set/unset tempfile
 Save automatically on exit, don't prompt.
 .TP
+.B set/unset undo
+Enable experimental generic-purpose undo code.
+.TP
 .B set/unset view
 Disallow file modification.
 .TP
index 6c5916a8e582ef899cac99be32f2f01269290d42..565632fed15014c07ae233c0b0222d2816515cc0 100644 (file)
@@ -89,6 +89,7 @@ static const rcoption rcopts[] = {
     {"smarthome", SMART_HOME},
     {"smooth", SMOOTH_SCROLL},
     {"tabstospaces", TABS_TO_SPACES},
+    {"undo", 0},
     {"whitespace", 0},
     {"wordbounds", WORD_BOUNDS},
 #endif
@@ -908,6 +909,15 @@ void parse_rcfile(FILE *rcstream
        option = ptr;
        ptr = parse_next_word(ptr);
 
+#ifndef NANO_TINY
+       /* FIXME: Hack which should go away ASAP */
+       if (strcasecmp(option,  "undo") == 0) {
+           use_undo = TRUE;
+           shortcut_init(0);
+           continue;
+       }
+#endif
+
        for (i = 0; rcopts[i].name != NULL; i++) {
            if (strcasecmp(option, rcopts[i].name) == 0) {
 #ifdef DEBUG