~mfisch/nano/update_to_2.3.1_try2

« back to all changes in this revision

Viewing changes to src/help.c

  • Committer: Matthew Fischer
  • Date: 2012-12-18 00:32:30 UTC
  • mfrom: (1.3.4)
  • Revision ID: matthew.fischer@canonical.com-20121218003230-7j2e22aylaebk74e
upgrading nano to 2.3.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* $Id: help.c 4453 2009-12-02 03:36:22Z astyanax $ */
 
1
/* $Id: help.c 4535 2011-02-26 14:22:37Z astyanax $ */
2
2
/**************************************************************************
3
3
 *   help.c                                                               *
4
4
 *                                                                        *
145
145
        if (!f)
146
146
            continue;
147
147
 
148
 
          if (f->scfunc == TOTAL_REFRESH) {
 
148
          if (f->scfunc == total_refresh) {
149
149
                total_redraw();
150
150
                break;
151
 
        } else if (f->scfunc == DO_PAGE_UP) {
 
151
        } else if (f->scfunc == do_page_up) {
152
152
                if (line > editwinrows - 2)
153
153
                    line -= editwinrows - 2;
154
154
                else
155
155
                    line = 0;
156
 
        } else if (f->scfunc == DO_PAGE_DOWN) {
 
156
        } else if (f->scfunc == do_page_down) {
157
157
                if (line + (editwinrows - 1) < last_line)
158
158
                    line += editwinrows - 2;
159
 
        } else if (f->scfunc == DO_UP_VOID) {
 
159
        } else if (f->scfunc == do_up_void) {
160
160
                if (line > 0)
161
161
                    line--;
162
 
        } else if (f->scfunc == DO_DOWN_VOID) {
 
162
        } else if (f->scfunc == do_down_void) {
163
163
                if (line + (editwinrows - 1) < last_line)
164
164
                    line++;
165
 
        } else if (f->scfunc == DO_FIRST_LINE) {
 
165
        } else if (f->scfunc == do_first_line) {
166
166
                if (meta_key)
167
167
                    line = 0;
168
168
                break;
169
 
        } else if (f->scfunc == DO_LAST_LINE) {
 
169
        } else if (f->scfunc == do_last_line) {
170
170
                if (meta_key) {
171
171
                    if (line + (editwinrows - 1) < last_line)
172
172
                        line = last_line - (editwinrows - 1);
173
173
                }
174
174
                break;
175
175
            /* Abort the help browser. */
176
 
        } else if (f->scfunc == DO_EXIT) {
 
176
        } else if (f->scfunc == do_exit) {
177
177
                abort = TRUE;
178
178
                break;
179
179
        }
407
407
        size_t endis_len = strlen(_("enable/disable"));
408
408
 
409
409
        for (s = sclist; s != NULL; s = s->next)
410
 
            if (s->scfunc ==  DO_TOGGLE)
 
410
            if (s->scfunc ==  do_toggle_void)
411
411
                allocsize += strlen(_(flagtostr(s->toggle))) + endis_len + 9;
412
412
 
413
413
    }
446
446
            if (scsfound == 3)
447
447
                continue;
448
448
 
449
 
            if (s->type == RAW)
 
449
            if (s->type == RAWINPUT)
450
450
                continue;
451
451
 
452
452
            if ((s->menu & currmenu) == 0)
478
478
    /* And the toggles... */
479
479
    if (currmenu == MMAIN)
480
480
        for (s = sclist; s != NULL; s = s->next)
481
 
            if (s->scfunc ==  DO_TOGGLE)
 
481
            if (s->scfunc == do_toggle_void)
482
482
                ptr += sprintf(ptr, "(%s)\t\t\t%s %s\n",
483
483
                    s->keystr, _(flagtostr(s->toggle)), _("enable/disable"));
484
484
 
507
507
        switch (*kbinput) {
508
508
            /* For consistency with the file browser. */
509
509
            case ' ':
510
 
                *kbinput = sc_seq_or(DO_PAGE_UP, 0);
 
510
                *kbinput = sc_seq_or(do_page_up, 0);
511
511
                break;
512
512
            case '-':
513
 
                *kbinput = sc_seq_or(DO_PAGE_DOWN, 0);;
 
513
                *kbinput = sc_seq_or(do_page_down, 0);;
514
514
                break;
515
515
            /* Cancel is equivalent to Exit here. */
516
516
            case 'E':
517
517
            case 'e':
518
 
                *kbinput = sc_seq_or(DO_EXIT, 0);;
 
518
                *kbinput = sc_seq_or(do_exit, 0);;
519
519
                break;
520
520
        }
521
521
    }