instead of putting it on a new line, as Pico does. (DLR)
- Convert instances of "(char *)nrealloc()" to the macro
charealloc(), which does the same thing. (DLR)
+ - Change justify_mode from a boolean int to a flag (DLR).
- cut.c:
do_cut_text()
- Tweak where KEEP_CUTBUFFER is set so that a marked cut
cutbuffer = inptr;
inptr->prev = NULL;
#ifndef NANO_SMALL
- } else if (concatenate_cut && !justify_mode) {
+ } else if (concatenate_cut && !ISSET(JUSTIFY_MODE)) {
/* Just tack the text in inptr onto the text in cutbottom,
unless we're backing up lines while justifying text. */
cutbottom->data = charealloc(cutbottom->data,
#endif
#ifndef DISABLE_JUSTIFY
-int justify_mode = 0; /* Whether we're justifying now. */
char *quotestr = NULL; /* Quote string. The default value is
set in main(). */
#endif
/* Next step, we loop through the lines of this paragraph, justifying
* each one individually. */
- justify_mode = 1;
+ SET(JUSTIFY_MODE);
for(; par_len > 0; current_y++, par_len--) {
size_t line_len;
size_t display_len;
continue_loc:
current = current->next;
}
- justify_mode = 0;
+ UNSET(JUSTIFY_MODE);
/* We are now done justifying the paragraph. There are cleanup things to
* do, and we check for unjustify. */
#define PRESERVE (1<<28)
#define HISTORY_CHANGED (1<<29)
#define HISTORYLOG (1<<30)
+#define JUSTIFY_MODE (1<<31)
/* Control key sequences, changing these would be very very bad */
extern int currslen;
#ifndef DISABLE_JUSTIFY
-extern int justify_mode;
extern char *quotestr;
#endif
#endif
#ifdef HAVE_REGEX_H
-extern int use_regexp, regexp_compiled;
extern regex_t search_regexp;
extern regmatch_t regmatches[10];
#ifdef ENABLE_COLOR