Commit 598106e5 authored by Chris Allegretta's avatar Chris Allegretta
Browse files

re-indent winio.c

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1020 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 159 additions and 156 deletions
+159 -156
......@@ -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);
}
}
......@@ -612,7 +612,7 @@ void bottombars(shortcut s[], int slen)
if (slen < 2)
k = COLS / 6 - 13;
else
k = COLS / ((slen + (slen %2)) / 2) - 13;
k = COLS / ((slen + (slen % 2)) / 2) - 13;
clear_bottomwin();
......@@ -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,15 +1359,17 @@ 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)]);
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)]);
ungetch(yesnosquare[mevent.y][mevent.x / (COLS / 6)]);
}
}
break;
......@@ -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, &current->data[current_x]);
highlight_word =
mallocstrcpy(highlight_word, &current->data[current_x]);
highlight_word[strlen(word)] = '\0';
/* adjust output when word extends beyond screen */
......@@ -1767,11 +1771,12 @@ 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");
char *credits[CREDIT_LEN] = {nanotext,
char *credits[CREDIT_LEN] = { nanotext,
version,
VERSION,
"",
......@@ -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)
......@@ -1854,7 +1860,7 @@ void do_credits(void)
curs_set(1);
display_main_list();
total_refresh();
}
}
#endif
int keypad_on(WINDOW * win, int newval)
......@@ -1873,6 +1879,3 @@ int keypad_on(WINDOW * win, int newval)
#endif /* HAVE_USEKEYPAD */
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment