tweaks: rename a variable, and frob a couple of comments
Also, conditionalize a statement that is only effective when multiple file buffers are available.master
parent
b4a955512e
commit
5ecd81bd19
27
src/nano.c
27
src/nano.c
|
@ -1896,9 +1896,9 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
bool old_multibuffer;
|
bool is_multibuffer;
|
||||||
/* The old value of the multibuffer option, restored after we
|
/* The actual value of the multibuffer option, restored after
|
||||||
* load all files on the command line. */
|
* we've loaded all files given on the command line. */
|
||||||
#endif
|
#endif
|
||||||
const struct option long_options[] = {
|
const struct option long_options[] = {
|
||||||
{"boldtext", 0, NULL, 'D'},
|
{"boldtext", 0, NULL, 'D'},
|
||||||
|
@ -2421,13 +2421,12 @@ int main(int argc, char **argv)
|
||||||
if (matchbrackets == NULL)
|
if (matchbrackets == NULL)
|
||||||
matchbrackets = mallocstrcpy(NULL, "(<[{)>]}");
|
matchbrackets = mallocstrcpy(NULL, "(<[{)>]}");
|
||||||
|
|
||||||
/* If whitespace wasn't specified, set its default value. If we're
|
/* If the whitespace option wasn't specified, set its default value. */
|
||||||
* using UTF-8, it's Unicode 00BB (Right-Pointing Double Angle
|
|
||||||
* Quotation Mark) and Unicode 00B7 (Middle Dot). Otherwise, it's
|
|
||||||
* ">" and ".". */
|
|
||||||
if (whitespace == NULL) {
|
if (whitespace == NULL) {
|
||||||
#ifdef ENABLE_UTF8
|
#ifdef ENABLE_UTF8
|
||||||
if (using_utf8()) {
|
if (using_utf8()) {
|
||||||
|
/* A tab is shown as a Right-Pointing Double Angle Quotation Mark
|
||||||
|
* (U+00BB), and a space as a Middle Dot (U+00B7). */
|
||||||
whitespace = mallocstrcpy(NULL, "\xC2\xBB\xC2\xB7");
|
whitespace = mallocstrcpy(NULL, "\xC2\xBB\xC2\xB7");
|
||||||
whitespace_len[0] = 2;
|
whitespace_len[0] = 2;
|
||||||
whitespace_len[1] = 2;
|
whitespace_len[1] = 2;
|
||||||
|
@ -2464,8 +2463,7 @@ int main(int argc, char **argv)
|
||||||
fprintf(stderr, "Main: set up windows\n");
|
fprintf(stderr, "Main: set up windows\n");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Initialize all the windows based on the current screen
|
/* Create the three subwindows, based on the current screen dimensions. */
|
||||||
* dimensions. */
|
|
||||||
window_init();
|
window_init();
|
||||||
|
|
||||||
editwincols = COLS;
|
editwincols = COLS;
|
||||||
|
@ -2528,7 +2526,7 @@ int main(int argc, char **argv)
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
old_multibuffer = ISSET(MULTIBUFFER);
|
is_multibuffer = ISSET(MULTIBUFFER);
|
||||||
SET(MULTIBUFFER);
|
SET(MULTIBUFFER);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2565,11 +2563,12 @@ int main(int argc, char **argv)
|
||||||
if (openfile == NULL) {
|
if (openfile == NULL) {
|
||||||
open_buffer("", FALSE);
|
open_buffer("", FALSE);
|
||||||
UNSET(VIEW_MODE);
|
UNSET(VIEW_MODE);
|
||||||
} else
|
}
|
||||||
|
#ifdef ENABLE_MULTIBUFFER
|
||||||
|
else
|
||||||
openfile = openfile->next;
|
openfile = openfile->next;
|
||||||
|
|
||||||
#ifdef ENABLE_MULTIBUFFER
|
if (!is_multibuffer)
|
||||||
if (!old_multibuffer)
|
|
||||||
UNSET(MULTIBUFFER);
|
UNSET(MULTIBUFFER);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -2583,7 +2582,7 @@ int main(int argc, char **argv)
|
||||||
#ifdef ENABLE_LINENUMBERS
|
#ifdef ENABLE_LINENUMBERS
|
||||||
int needed_margin = digits(openfile->filebot->lineno) + 1;
|
int needed_margin = digits(openfile->filebot->lineno) + 1;
|
||||||
|
|
||||||
/* Only enable line numbers when there is enough room for them. */
|
/* Suppress line numbers when there is not enough room for them. */
|
||||||
if (!ISSET(LINE_NUMBERS) || needed_margin > COLS - 4)
|
if (!ISSET(LINE_NUMBERS) || needed_margin > COLS - 4)
|
||||||
needed_margin = 0;
|
needed_margin = 0;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue