Commit 26de2dd8 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

Normalizing some indentation and whitespace.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5025 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
No related merge requests found
Showing with 44 additions and 45 deletions
+44 -45
...@@ -12,6 +12,8 @@ ...@@ -12,6 +12,8 @@
Remove these functions and thus the ability to search for a matching Remove these functions and thus the ability to search for a matching
bracket in a prompt input line. The find_bracket function never had bracket in a prompt input line. The find_bracket function never had
a default keybinding outside MMAIN, so is unlikely to have been used. a default keybinding outside MMAIN, so is unlikely to have been used.
* src/prompt.c (do_statusbar_input): Normalize the indentation.
* src/winio.c: Normalize some whitespace.
2014-06-25 Benno Schulenberg <bensberg@justemail.net> 2014-06-25 Benno Schulenberg <bensberg@justemail.net>
* src/browser.c (do_browser): Allow 'firstfile' and 'lastfile' to be * src/browser.c (do_browser): Allow 'firstfile' and 'lastfile' to be
......
...@@ -156,7 +156,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, ...@@ -156,7 +156,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut,
; ;
else if (s->scfunc == total_refresh) else if (s->scfunc == total_refresh)
total_statusbar_refresh(refresh_func); total_statusbar_refresh(refresh_func);
else if (s->scfunc == do_cut_text_void) { else if (s->scfunc == do_cut_text_void) {
/* If we're using restricted mode, the filename /* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File" * isn't blank, and we're at the "Write File"
* prompt, disable Cut. */ * prompt, disable Cut. */
...@@ -167,39 +167,36 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, ...@@ -167,39 +167,36 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut,
do_statusbar_right(); do_statusbar_right();
else if (s->scfunc == do_left) else if (s->scfunc == do_left)
do_statusbar_left(); do_statusbar_left();
#ifndef NANO_TINY #ifndef NANO_TINY
else if (s->scfunc == do_next_word_void) else if (s->scfunc == do_next_word_void)
do_statusbar_next_word(FALSE); do_statusbar_next_word(FALSE);
else if (s->scfunc == do_prev_word_void) else if (s->scfunc == do_prev_word_void)
do_statusbar_prev_word(FALSE); do_statusbar_prev_word(FALSE);
#endif #endif
else if (s->scfunc == do_home) else if (s->scfunc == do_home)
do_statusbar_home(); do_statusbar_home();
else if (s->scfunc == do_end) else if (s->scfunc == do_end)
do_statusbar_end(); do_statusbar_end();
else if (s->scfunc == do_verbatim_input) { else if (s->scfunc == do_verbatim_input) {
/* If we're using restricted mode, the filename /* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File" * isn't blank, and we're at the "Write File"
* prompt, disable verbatim input. */ * prompt, disable verbatim input. */
if (!ISSET(RESTRICTED) || if (!ISSET(RESTRICTED) || currmenu != MWRITEFILE ||
openfile->filename[0] == '\0' || openfile->filename[0] == '\0') {
currmenu != MWRITEFILE) { bool got_enter;
bool got_enter; /* Whether we got the Enter key. */
/* Whether we got the Enter key. */
do_statusbar_verbatim_input(&got_enter);
do_statusbar_verbatim_input(&got_enter);
/* If we got the Enter key, remove it from the input
/* If we got the Enter key, remove it from * buffer, set input to the key value for Enter, and
* the input buffer, set input to the key * set finished to TRUE to indicate that we're done. */
* value for Enter, and set finished to TRUE if (got_enter) {
* to indicate that we're done. */ get_input(NULL, 1);
if (got_enter) { input = sc_seq_or(do_enter_void, 0);
get_input(NULL, 1); *finished = TRUE;
input = sc_seq_or(do_enter_void, 0);
*finished = TRUE;
}
} }
}
} else if (s->scfunc == do_delete) { } else if (s->scfunc == do_delete) {
/* If we're using restricted mode, the filename /* If we're using restricted mode, the filename
* isn't blank, and we're at the "Write File" * isn't blank, and we're at the "Write File"
...@@ -224,7 +221,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut, ...@@ -224,7 +221,7 @@ int do_statusbar_input(bool *meta_key, bool *func_key, bool *have_shortcut,
if (s->scfunc != 0 && s->execute == TRUE) { if (s->scfunc != 0 && s->execute == TRUE) {
*ran_func = TRUE; *ran_func = TRUE;
if (f && (!ISSET(VIEW_MODE) || (f->viewok))) if (f && (!ISSET(VIEW_MODE) || (f->viewok)))
f->scfunc(); f->scfunc();
} }
*finished = TRUE; *finished = TRUE;
} }
......
...@@ -124,7 +124,7 @@ void get_key_buffer(WINDOW *win) ...@@ -124,7 +124,7 @@ void get_key_buffer(WINDOW *win)
errcount = 0; errcount = 0;
if (nodelay_mode) { if (nodelay_mode) {
if ((input = wgetch(win)) == ERR) if ((input = wgetch(win)) == ERR)
return; return;
} else } else
while ((input = wgetch(win)) == ERR) { while ((input = wgetch(win)) == ERR) {
errcount++; errcount++;
...@@ -1696,14 +1696,14 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) ...@@ -1696,14 +1696,14 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
/* Go through the list of functions to determine which /* Go through the list of functions to determine which
* shortcut in the current menu we released/clicked on. */ * shortcut in the current menu we released/clicked on. */
for (f = allfuncs; f != NULL; f = f->next) { for (f = allfuncs; f != NULL; f = f->next) {
if ((f->menus & currmenu) == 0) if ((f->menus & currmenu) == 0)
continue; continue;
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
if (!f->help || strlen(f->help) == 0) if (!f->help || strlen(f->help) == 0)
continue; continue;
#endif #endif
if (first_sc_for(currmenu, f->scfunc) == NULL) if (first_sc_for(currmenu, f->scfunc) == NULL)
continue; continue;
/* Tick off an actually shown shortcut. */ /* Tick off an actually shown shortcut. */
j -= 1; j -= 1;
if (j == 0) if (j == 0)
...@@ -1715,7 +1715,7 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts) ...@@ -1715,7 +1715,7 @@ int get_mouseinput(int *mouse_x, int *mouse_y, bool allow_shortcuts)
/* And put the corresponding key into the keyboard buffer. */ /* And put the corresponding key into the keyboard buffer. */
if (f != NULL) { if (f != NULL) {
const sc *s = first_sc_for(currmenu, f->scfunc); const sc *s = first_sc_for(currmenu, f->scfunc);
unget_kbinput(s->seq, s->type == META, s->type == FKEY); unget_kbinput(s->seq, s->type == META, s->type == FKEY);
} }
return 1; return 1;
...@@ -1774,7 +1774,7 @@ const sc *get_shortcut(int menu, int *kbinput, bool *meta_key) ...@@ -1774,7 +1774,7 @@ const sc *get_shortcut(int menu, int *kbinput, bool *meta_key)
#endif #endif
for (s = sclist; s != NULL; s = s->next) { for (s = sclist; s != NULL; s = s->next) {
if ((menu & s->menu) && *kbinput == s->seq if ((menu & s->menu) && *kbinput == s->seq
&& *meta_key == (s->type == META)) { && *meta_key == (s->type == META)) {
#ifdef DEBUG #ifdef DEBUG
fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menu is %x from %x)\n", fprintf (stderr, "matched seq \"%s\", and btw meta was %d (menu is %x from %x)\n",
...@@ -2250,12 +2250,12 @@ void set_modified(void) ...@@ -2250,12 +2250,12 @@ void set_modified(void)
if (openfile->filename[0] == '\0') if (openfile->filename[0] == '\0')
return; return;
else if (openfile->lock_filename == NULL) { else if (openfile->lock_filename == NULL) {
/* TRANSLATORS: Try to keep this at most 76 characters. */ /* TRANSLATORS: Try to keep this at most 76 characters. */
statusbar(_("Warning: Modifying a file which is not locked, check directory permission?")); statusbar(_("Warning: Modifying a file which is not locked, check directory permission?"));
} else { } else {
write_lockfile(openfile->lock_filename, write_lockfile(openfile->lock_filename,
get_full_path(openfile->filename), TRUE); get_full_path(openfile->filename), TRUE);
} }
} }
#endif #endif
} }
...@@ -2367,30 +2367,30 @@ void bottombars(int menu) ...@@ -2367,30 +2367,30 @@ void bottombars(int menu)
for (f = allfuncs, i = 0; i < slen && f != NULL; f = f->next) { for (f = allfuncs, i = 0; i < slen && f != NULL; f = f->next) {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Checking menu items...."); fprintf(stderr, "Checking menu items....");
#endif #endif
if ((f->menus & menu) == 0) if ((f->menus & menu) == 0)
continue; continue;
if (!f->desc || strlen(f->desc) == 0) if (!f->desc || strlen(f->desc) == 0)
continue; continue;
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "found one! f->menus = %x, desc = \"%s\"\n", f->menus, f->desc); fprintf(stderr, "found one! f->menus = %x, desc = \"%s\"\n", f->menus, f->desc);
#endif #endif
s = first_sc_for(menu, f->scfunc); s = first_sc_for(menu, f->scfunc);
if (s == NULL) { if (s == NULL) {
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Whoops, guess not, no shortcut key found for func!\n"); fprintf(stderr, "Whoops, guess not, no shortcut key found for func!\n");
#endif #endif
continue; continue;
} }
wmove(bottomwin, 1 + i % 2, (i / 2) * colwidth); wmove(bottomwin, 1 + i % 2, (i / 2) * colwidth);
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "Calling onekey with keystr \"%s\" and desc \"%s\"\n", s->keystr, f->desc); fprintf(stderr, "Calling onekey with keystr \"%s\" and desc \"%s\"\n", s->keystr, f->desc);
#endif #endif
onekey(s->keystr, _(f->desc), colwidth + (COLS % colwidth)); onekey(s->keystr, _(f->desc), colwidth + (COLS % colwidth));
i++; i++;
} }
wnoutrefresh(bottomwin); wnoutrefresh(bottomwin);
......
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