diff --git a/ChangeLog b/ChangeLog index 0295463a..3b798ab3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ Cvs code - - General - New global variables currshortcut and currslen to support using the mouse with the shortcuts. Also supports clicking on files - in browser. + in browser. Added #ifdef DISABLE_MOUSE around this code also. - Changed mouse disabling code from depending on --enable-tiny to its own flag, --disable-mouse. The --tiny option defines this automatically, but now just mouse support can be disabled @@ -23,6 +23,14 @@ Cvs code - - Changed all string allocations to charalloc(), new function designed to take nmalloc argument but call calloc based on (char *) size. + - New macro DISABLE_WRAPJUSTIFY to easily check for both wrapping + and justify being disabled. This allows us to compile out the + -r flag if neither are set, and will also allow us to comment + out -W when it is written. + - Allow fill to take a negative value ot signify a "from right side" + value. This allows the value to vary with the screen size yet + still be correct. New static value wrap_at to minimize code + inpact. Updated man page and info file. - configure.in: - New option, --enable-nanorc, which allows people to have a .nanorc initialization file and set options normally used on the command diff --git a/TODO b/TODO index b7be5bf4..d2bcf193 100644 --- a/TODO +++ b/TODO @@ -30,6 +30,7 @@ For Next Version: make global variable pointing to current shortcut list to determine what keystroke to ungetch(). [DONE]. - Implement -o (chroot of sorts) -- Implement -W (wrap at # less than width of screen), mark -r as deprecated. +- Allow -r to take a negative argument, meaning right margin instead of + left (allows resizing that way), formerly -W arg. [DONE] $Id$ diff --git a/files.c b/files.c index ac626ba3..70f3e9ac 100644 --- a/files.c +++ b/files.c @@ -259,8 +259,12 @@ int do_insertfile(void) char *realname = NULL; wrap_reset(); + +#ifndef DISABLE_MOUSE currshortcut = writefile_list; currslen = WRITEFILE_LIST_LEN; +#endif + i = statusq(1, writefile_list, WRITEFILE_LIST_LEN, "", _("File to insert [from ./] ")); if (i != -1) { @@ -279,8 +283,10 @@ int do_insertfile(void) if (i == NANO_TOFILES_KEY) { char *tmp = do_browse_from(realname); +#ifndef DISABLE_MOUSE currshortcut = writefile_list; currslen = WRITEFILE_LIST_LEN; +#endif #ifdef DISABLE_TABCOMP realname = NULL; @@ -508,8 +514,11 @@ int do_writeout(char *path, int exiting) static int did_cred = 0; #endif +#ifndef DISABLE_MOUSE currshortcut = writefile_list; currslen = WRITEFILE_LIST_LEN; +#endif + answer = mallocstrcpy(answer, path); if ((exiting) && (ISSET(TEMP_OPT))) { @@ -536,8 +545,11 @@ int do_writeout(char *path, int exiting) if (i == NANO_TOFILES_KEY) { char *tmp = do_browse_from(answer); + +#ifndef DISABLE_MOUSE currshortcut = writefile_list; currslen = WRITEFILE_LIST_LEN; +#endif if (tmp != NULL) answer = mallocstrcpy(answer, tmp); @@ -1178,8 +1190,11 @@ char *do_browser(char *inpath) blank_statusbar_refresh(); +#ifndef DISABLE_MOUSE currshortcut = browser_list; currslen = BROWSER_LIST_LEN; +#endif + editline = 0; col = 0; diff --git a/global.c b/global.c index dc065956..2bc4cde7 100644 --- a/global.c +++ b/global.c @@ -92,8 +92,10 @@ shortcut browser_list[BROWSER_LIST_LEN]; colorstruct colors[NUM_NCOLORS]; #endif +#ifndef DISABLE_MOUSE shortcut *currshortcut = main_list; /* Current shortcut list we're using */ int currslen = MAIN_VISIBLE; /* Length of current shortcut list */ +#endif #ifndef NANO_SMALL toggle toggles[TOGGLE_LEN]; diff --git a/nano.1 b/nano.1 index fd47e66f..94e67e95 100644 --- a/nano.1 +++ b/nano.1 @@ -70,7 +70,9 @@ search and replace strings. .TP .B \-r (\-\-fill) Wrap lines at column #cols. By default, this is the width of the screen, -less eight. +less eight. If this value is negative, wrapping will occur at #cols from +the right of the screen, allowing it to vary along with the screen width +if the screen is resized. .TP .B \-s (\-\-speller) Enable alternative spell checker command. diff --git a/nano.1.html b/nano.1.html index 7a95f407..3ef0b8f9 100644 --- a/nano.1.html +++ b/nano.1.html @@ -93,7 +93,9 @@ search and replace strings.