NANO_SMALL is defined. (DLR)
- Source reorganization: move code to src/, docs to doc/. (Jordi)
- Translation updates (see po/ChangeLog for details).
+ - Since SAMELINEWRAP is only used in nano.c, make it a static
+ variable in nano.c instead of a flag, and surround all
+ wrap_reset() calls with DISABLE_WRAPPING #ifdefs. (DLR)
- files.c:
do_browser()
- Some of the Pico compatibility options in the file browser
page_up()
- Removed due to rewrite of movement functions. (David
Benbennick)
+- proto.h:
+ - Surround the do_prev_word() and do_next_word() prototypes with
+ NANO_SMALL #ifdefs, since the actual functions aren't included
+ in tiny mode. (DLR)
- rcfile.c:
parse_colors()
- Generate an error if we try to use a bright background color
filestruct *hold = current;
int i;
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
check_statblank();
if (cutbuffer == NULL || fileptr == NULL)
return 0; /* AIEEEEEEEEEEEE */
inspath[0] = '\0';
}
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
#if !defined(DISABLE_BROWSER) || !defined(NANO_SMALL) && defined(ENABLE_MULTIBUFFER)
start_again: /* Goto here when the user cancels the file browser. */
{
int i;
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
/* If edittop is the first line of the file, move current up there
* and put the cursor at the beginning of the line. */
{
int i;
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
/* If the last line of the file is onscreen, move current down
* there and put the cursor at the beginning of the line. */
int do_up(void)
{
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
check_statblank();
if (current->prev == NULL)
* bottom. */
int do_down(void)
{
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
check_statblank();
if (current->next == NULL)
#ifndef DISABLE_WRAPJUSTIFY
static int fill = 0; /* Fill - where to wrap lines, basically */
#endif
+#ifndef DISABLE_WRAPPING
+static int same_line_wrap = 0; /* Whether wrapped text should be
+ prepended to the next line */
+#endif
static struct termios oldterm; /* The user's original term settings */
static struct sigaction act; /* For all our fun signal handlers */
return 1;
}
+#ifndef DISABLE_WRAPPING
void wrap_reset(void)
{
- UNSET(SAMELINEWRAP);
+ same_line_wrap = 0;
}
+#endif
#ifndef DISABLE_WRAPPING
/* We wrap the given line. Precondition: we assume the cursor has been
/* We prepend the wrapped text to the next line, if the flag is set,
* and there is a next line, and prepending would not make the line
* too long. */
- if (ISSET(SAMELINEWRAP) && inptr->next) {
+ if (same_line_wrap && inptr->next) {
wrap_line = inptr->next->data;
wrap_line_len = strlen(wrap_line);
* other sundry things. */
/* later wraps of this line will be prepended to the next line. */
- SET(SAMELINEWRAP);
+ same_line_wrap = 1;
/* Each line knows its line number. We recalculate these if we
* inserted a new line. */
#endif
#ifndef NANO_SMALL
- /* For the backup file copy ... */
-# define COPYFILEBLOCKSIZE 1024
+/* For the backup file copy ... */
+#define COPYFILEBLOCKSIZE 1024
#endif
-#ifdef USE_SLANG /* Slang support enabled */
+#ifdef USE_SLANG
+/* Slang support enabled */
#include <slcurses.h>
#define KEY_DC SL_KEY_DELETE
#define KEY_IC SL_KEY_IC
#elif defined(HAVE_NCURSES_H)
#include <ncurses.h>
#else /* Uh oh */
-#include <curses.h>
+#include <curses.h>
#endif /* CURSES_H */
#ifdef ENABLE_NLS
#define SUSPEND (1<<7)
#define NO_WRAP (1<<8)
#define AUTOINDENT (1<<9)
-#define SAMELINEWRAP (1<<10)
-#define VIEW_MODE (1<<11)
-#define USE_MOUSE (1<<12)
-#define USE_REGEXP (1<<13)
-#define REGEXP_COMPILED (1<<14)
-#define TEMP_OPT (1<<15)
-#define CUT_TO_END (1<<16)
-#define REVERSE_SEARCH (1<<17)
-#define MULTIBUFFER (1<<18)
-#define DOS_FILE (1<<19)
-#define MAC_FILE (1<<20)
-#define SMOOTHSCROLL (1<<21)
-#define DISABLE_CURPOS (1<<22) /* Damn, we still need it */
-#define REBIND_DELETE (1<<23)
-#define NO_CONVERT (1<<24)
-#define BACKUP_FILE (1<<25)
-#define NO_RCFILE (1<<26)
-#define COLOR_SYNTAX (1<<27)
-#define PRESERVE (1<<28)
-#define HISTORY_CHANGED (1<<29)
-#define HISTORYLOG (1<<30)
-#define JUSTIFY_MODE (1<<31)
+#define VIEW_MODE (1<<10)
+#define USE_MOUSE (1<<11)
+#define USE_REGEXP (1<<12)
+#define REGEXP_COMPILED (1<<13)
+#define TEMP_OPT (1<<14)
+#define CUT_TO_END (1<<15)
+#define REVERSE_SEARCH (1<<16)
+#define MULTIBUFFER (1<<17)
+#define DOS_FILE (1<<18)
+#define MAC_FILE (1<<19)
+#define SMOOTHSCROLL (1<<20)
+#define DISABLE_CURPOS (1<<21) /* Damn, we still need it */
+#define REBIND_DELETE (1<<22)
+#define NO_CONVERT (1<<23)
+#define BACKUP_FILE (1<<24)
+#define NO_RCFILE (1<<25)
+#define COLOR_SYNTAX (1<<26)
+#define PRESERVE (1<<27)
+#define HISTORY_CHANGED (1<<28)
+#define HISTORYLOG (1<<29)
+#define JUSTIFY_MODE (1<<30)
/* Control key sequences, changing these would be very very bad */
int do_delete(void);
int do_tab(void);
int do_enter(void);
+#ifndef NANO_SMALL
int do_next_word(void);
int do_prev_word(void);
+#endif
int do_mark(void);
-void wrap_reset(void);
#ifndef DISABLE_WRAPPING
+void wrap_reset(void);
int do_wrap(filestruct *inptr);
#endif
#ifndef DISABLE_SPELLER
filestruct *fileptr = current, *didfind;
int fileptr_x = current_x;
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
i = search_init(0);
switch (i) {
case -1:
const char *regex_error = _("Invalid regex \"%s\"");
#endif /* HAVE_REGEX_H */
+#ifndef DISABLE_WRAPPING
wrap_reset();
+#endif
search_init_globals();
if (last_search[0] != '\0') {