re-indent winio.c
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1020 35c25a1d-7b9e-4130-9fde-d3aeb78583b8master
parent
69bba322f5
commit
598106e55a
63
winio.c
63
winio.c
|
@ -241,8 +241,7 @@ void nanoget_repaint(char *buf, char *inputbuf, int x)
|
|||
mvwaddstr(bottomwin, 0, 0, buf);
|
||||
waddnstr(bottomwin, inputbuf, wid);
|
||||
wmove(bottomwin, 0, (x % COLS));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
/* Black magic */
|
||||
buf[len - 1] = '$';
|
||||
|
||||
|
@ -299,8 +298,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
|||
|
||||
#ifndef DISABLE_HELP
|
||||
/* Have to do this here, it would be too late to do it in statusq */
|
||||
if (kbinput == NANO_HELP_KEY
|
||||
|| kbinput == NANO_HELP_FKEY) {
|
||||
if (kbinput == NANO_HELP_KEY || kbinput == NANO_HELP_FKEY) {
|
||||
do_help();
|
||||
break;
|
||||
}
|
||||
|
@ -463,7 +461,8 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
|||
|
||||
for (j = 0; j <= slen - 1; j++) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, _("Aha! \'%c\' (%d)\n"), kbinput, kbinput);
|
||||
fprintf(stderr, _("Aha! \'%c\' (%d)\n"), kbinput,
|
||||
kbinput);
|
||||
#endif
|
||||
if (kbinput == s[j].val || kbinput == s[j].val - 32) {
|
||||
|
||||
|
@ -488,8 +487,7 @@ int nanogetstr(int allowtabs, char *buf, char *def, shortcut s[], int slen,
|
|||
inputbuf = nrealloc(inputbuf, inputlen + 2);
|
||||
|
||||
memmove(&inputbuf[x - x_left + 1],
|
||||
&inputbuf[x - x_left],
|
||||
inputlen - (x - x_left) + 1);
|
||||
&inputbuf[x - x_left], inputlen - (x - x_left) + 1);
|
||||
inputbuf[x - x_left] = kbinput;
|
||||
|
||||
x++;
|
||||
|
@ -553,9 +551,11 @@ void titlebar(char *path)
|
|||
waddstr(topwin, &what[namelen - space]);
|
||||
} else {
|
||||
if (path == NULL)
|
||||
mvwaddstr(topwin, 0, COLS / 2 - (namelen / 2 + 1), _("File: "));
|
||||
mvwaddstr(topwin, 0, COLS / 2 - (namelen / 2 + 1),
|
||||
_("File: "));
|
||||
else
|
||||
mvwaddstr(topwin, 0, COLS / 2 - (namelen / 2 + 1), _(" DIR: "));
|
||||
mvwaddstr(topwin, 0, COLS / 2 - (namelen / 2 + 1),
|
||||
_(" DIR: "));
|
||||
waddstr(topwin, what);
|
||||
}
|
||||
}
|
||||
|
@ -785,7 +785,8 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
|||
|
||||
#ifdef ENABLE_COLOR
|
||||
if (colorstrings != NULL)
|
||||
for (tmpcolor = colorstrings; tmpcolor != NULL; tmpcolor = tmpcolor->next) {
|
||||
for (tmpcolor = colorstrings; tmpcolor != NULL;
|
||||
tmpcolor = tmpcolor->next) {
|
||||
|
||||
k = start;
|
||||
regcomp(&search_regexp, tmpcolor->start, 0);
|
||||
|
@ -807,7 +808,8 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
|||
wattron(edit, COLOR_PAIR(tmpcolor->pairnum));
|
||||
|
||||
if (regmatches[0].rm_eo + k <= COLS)
|
||||
paintlen = regmatches[0].rm_eo - regmatches[0].rm_so;
|
||||
paintlen =
|
||||
regmatches[0].rm_eo - regmatches[0].rm_so;
|
||||
else
|
||||
paintlen = COLS - k - regmatches[0].rm_so - 1;
|
||||
|
||||
|
@ -888,7 +890,8 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
|||
#endif /* ENABLE_COLOR */
|
||||
|
||||
target =
|
||||
(virt_mark_beginx < COLS - 1) ? virt_mark_beginx : COLS - 1;
|
||||
(virt_mark_beginx <
|
||||
COLS - 1) ? virt_mark_beginx : COLS - 1;
|
||||
|
||||
mvwaddnstr(edit, yval, 0, fileptr->data, target);
|
||||
|
||||
|
@ -967,7 +970,8 @@ void edit_add(filestruct * fileptr, int yval, int start, int virt_cur_x,
|
|||
this_page_end - virt_cur_x);
|
||||
else
|
||||
mvwaddnstr(edit, yval, virt_cur_x,
|
||||
&fileptr->data[virt_cur_x], COLS - virt_cur_x);
|
||||
&fileptr->data[virt_cur_x],
|
||||
COLS - virt_cur_x);
|
||||
|
||||
#ifdef ENABLE_COLOR
|
||||
color_off(edit, COLOR_MARKER);
|
||||
|
@ -1355,13 +1359,15 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
|
|||
if (all) {
|
||||
char yesnosquare[2][2] = {
|
||||
{yesstr[0], allstr[0]},
|
||||
{nostr[0], NANO_CONTROL_C }};
|
||||
{nostr[0], NANO_CONTROL_C}
|
||||
};
|
||||
|
||||
ungetch(yesnosquare[mevent.y][mevent.x / (COLS / 6)]);
|
||||
} else {
|
||||
char yesnosquare[2][2] = {
|
||||
{yesstr[0], '\0'},
|
||||
{nostr[0], NANO_CONTROL_C }};
|
||||
{nostr[0], NANO_CONTROL_C}
|
||||
};
|
||||
|
||||
ungetch(yesnosquare[mevent.y][mevent.x / (COLS / 6)]);
|
||||
}
|
||||
|
@ -1375,23 +1381,20 @@ int do_yesno(int all, int leavecursor, char *msg, ...)
|
|||
default:
|
||||
|
||||
/* Look for the kbinput in the yes, no and (optimally) all str */
|
||||
for (i = 0; yesstr[i] != 0 && yesstr[i] != kbinput; i++)
|
||||
;
|
||||
for (i = 0; yesstr[i] != 0 && yesstr[i] != kbinput; i++);
|
||||
if (yesstr[i] != 0) {
|
||||
ok = 1;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; nostr[i] != 0 && nostr[i] != kbinput; i++)
|
||||
;
|
||||
for (i = 0; nostr[i] != 0 && nostr[i] != kbinput; i++);
|
||||
if (nostr[i] != 0) {
|
||||
ok = 0;
|
||||
break;
|
||||
}
|
||||
|
||||
if (all) {
|
||||
for (i = 0; allstr[i] != 0 && allstr[i] != kbinput; i++)
|
||||
;
|
||||
for (i = 0; allstr[i] != 0 && allstr[i] != kbinput; i++);
|
||||
if (allstr[i] != 0) {
|
||||
ok = 2;
|
||||
break;
|
||||
|
@ -1518,7 +1521,8 @@ int do_cursorpos(int constant)
|
|||
unconditionally; otherwise, only display the position when the
|
||||
character values have changed */
|
||||
if (!constant || (old_i != i || old_totsize != totsize)) {
|
||||
statusbar(_("line %d of %d (%.0f%%), character %ld of %ld (%.0f%%)"),
|
||||
statusbar(_
|
||||
("line %d of %d (%.0f%%), character %ld of %ld (%.0f%%)"),
|
||||
current->lineno, totlines, linepct, i, totsize, bytepct);
|
||||
}
|
||||
|
||||
|
@ -1660,8 +1664,7 @@ int do_help(void)
|
|||
wrefresh(bottomwin);
|
||||
SET(NO_HELP);
|
||||
window_init();
|
||||
}
|
||||
else
|
||||
} else
|
||||
bottombars(currshortcut, currslen);
|
||||
|
||||
curs_set(1);
|
||||
|
@ -1727,7 +1730,8 @@ void do_replace_highlight(int highlight_flag, char *word)
|
|||
char *highlight_word = NULL;
|
||||
int x, y;
|
||||
|
||||
highlight_word = mallocstrcpy(highlight_word, ¤t->data[current_x]);
|
||||
highlight_word =
|
||||
mallocstrcpy(highlight_word, ¤t->data[current_x]);
|
||||
highlight_word[strlen(word)] = '\0';
|
||||
|
||||
/* adjust output when word extends beyond screen */
|
||||
|
@ -1767,7 +1771,8 @@ void do_credits(void)
|
|||
char *brought = _("Brought to you by:");
|
||||
char *specialthx = _("Special thanks to:");
|
||||
char *fsf = _("The Free Software Foundation");
|
||||
char *ncurses = _("Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses");
|
||||
char *ncurses =
|
||||
_("Pavel Curtis, Zeyd Ben-Halim and Eric S. Raymond for ncurses");
|
||||
char *anyonelse = _("and anyone else we forgot...");
|
||||
char *thankyou = _("Thank you for using nano!\n");
|
||||
|
||||
|
@ -1827,7 +1832,8 @@ void do_credits(void)
|
|||
while (wgetch(edit) == ERR) {
|
||||
for (k = 0; k <= 1; k++) {
|
||||
blank_edit();
|
||||
for (i = editwinrows / 2 - 1; i >= (editwinrows / 2 - 1 - j); i--) {
|
||||
for (i = editwinrows / 2 - 1; i >= (editwinrows / 2 - 1 - j);
|
||||
i--) {
|
||||
mvwaddstr(edit, i * 2 - k, 0, hblank);
|
||||
|
||||
if (place - (editwinrows / 2 - 1 - i) < CREDIT_LEN)
|
||||
|
@ -1873,6 +1879,3 @@ int keypad_on(WINDOW * win, int newval)
|
|||
#endif /* HAVE_USEKEYPAD */
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue