Changeset 8565a42 in mainline for uspace/dist/src/c/demos/edit


Ignore:
Timestamp:
2018-03-02T20:34:50Z (8 years ago)
Author:
GitHub <noreply@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
a1a81f69, d5e5fd1
Parents:
3061bc1 (diff), 34e1206 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
git-author:
Jiří Zárevúcky <zarevucky.jiri@…> (2018-03-02 20:34:50)
git-committer:
GitHub <noreply@…> (2018-03-02 20:34:50)
Message:

Remove all trailing whitespace, everywhere.

See individual commit messages for details.

Location:
uspace/dist/src/c/demos/edit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • uspace/dist/src/c/demos/edit/edit.c

    r3061bc1 r8565a42  
    8888         */
    8989        int ideal_column;
    90        
     90
    9191        char *previous_search;
    9292        bool previous_search_reverse;
     
    532532                pane.rflags |= REDRAW_TEXT;
    533533        }
    534        
     534
    535535        if (update_ideal_column)
    536536                pane.ideal_column = c_new.column;
    537        
     537
    538538        caret_update();
    539539}
     
    608608        const char *old_fname = (doc.file_name != NULL) ? doc.file_name : "";
    609609        char *fname;
    610        
     610
    611611        fname = prompt("Save As", old_fname);
    612612        if (fname == NULL) {
     
    815815
    816816        /* Clear the remaining rows if file is short. */
    817        
     817
    818818        int i;
    819819        sysarg_t j;
     
    905905                                console_flush(con);
    906906                        }
    907        
     907
    908908                        if ((csel_end.row == rbc.row) && (csel_end.column == s_column)) {
    909909                                console_flush(con);
     
    911911                                console_flush(con);
    912912                        }
    913        
     913
    914914                        c = str_decode(row_buf, &pos, size);
    915915                        if (c != '\t') {
     
    966966        int n = printf(" %d, %d (%d): File '%s'. Ctrl-Q Quit  Ctrl-S Save  "
    967967            "Ctrl-E Save As", coord.row, coord.column, last_row, fname);
    968        
     968
    969969        int pos = scr_columns - 1 - n;
    970970        printf("%*s", pos, "");
     
    11511151        coord.row = row;
    11521152        coord.column = column;
    1153        
     1153
    11541154        spt_t pt;
    11551155        sheet_get_cell_pt(doc.sh, &coord, align_dir, &pt);
    1156        
     1156
    11571157        caret_move(pt, select, true);
    11581158}
     
    11961196{
    11971197        char *sline;
    1198        
     1198
    11991199        sline = prompt("Go to line", "");
    12001200        if (sline == NULL) {
     
    12021202                return;
    12031203        }
    1204        
     1204
    12051205        char *endptr;
    12061206        int line = strtol(sline, &endptr, 10);
     
    12111211        }
    12121212        free(sline);
    1213        
     1213
    12141214        caret_move_absolute(line, pane.ideal_column, dir_before, false);
    12151215}
     
    12701270{
    12711271        char *pattern;
    1272        
     1272
    12731273        const char *prompt_text = "Find next";
    12741274        if (reverse)
    12751275                prompt_text = "Find previous";
    1276        
     1276
    12771277        const char *default_value = "";
    12781278        if (pane.previous_search)
    12791279                default_value = pane.previous_search;
    1280        
     1280
    12811281        pattern = prompt(prompt_text, default_value);
    12821282        if (pattern == NULL) {
     
    12841284                return;
    12851285        }
    1286        
     1286
    12871287        if (pane.previous_search)
    12881288                free(pane.previous_search);
    12891289        pane.previous_search = pattern;
    12901290        pane.previous_search_reverse = reverse;
    1291        
     1291
    12921292        search(pattern, reverse);
    12931293}
     
    12991299                return;
    13001300        }
    1301        
     1301
    13021302        search(pane.previous_search, pane.previous_search_reverse);
    13031303}
     
    13061306{
    13071307        status_display("Searching...");
    1308        
     1308
    13091309        spt_t sp, producer_pos;
    13101310        tag_get_pt(&pane.caret_pos, &sp);
    1311        
     1311
    13121312        /* Start searching on the position before/after caret */
    13131313        if (!reverse) {
     
    13181318        }
    13191319        producer_pos = sp;
    1320        
     1320
    13211321        search_ops_t ops = search_spt_ops;
    13221322        if (reverse)
    13231323                ops = search_spt_reverse_ops;
    1324        
     1324
    13251325        search_t *search = search_init(pattern, &producer_pos, ops, reverse);
    13261326        if (search == NULL) {
     
    13281328                return;
    13291329        }
    1330        
     1330
    13311331        match_t match;
    13321332        errno_t rc = search_next_match(search, &match);
     
    13351335                search_fini(search);
    13361336        }
    1337        
     1337
    13381338        if (match.end) {
    13391339                status_display("Match found.");
     
    13561356                status_display("Not found.");
    13571357        }
    1358        
     1358
    13591359        search_fini(search);
    13601360}
     
    16491649        console_set_pos(con, 0, scr_rows - 1);
    16501650        console_set_style(con, STYLE_INVERTED);
    1651        
     1651
    16521652        int pos = -(scr_columns - 3);
    16531653        printf(" %*s ", pos, str);
  • uspace/dist/src/c/demos/edit/search.c

    r3061bc1 r8565a42  
    4848        if (search == NULL)
    4949                return NULL;
    50        
     50
    5151        wchar_t *p = str_to_awstr(pattern);
    5252        if (p == NULL) {
     
    5454                return NULL;
    5555        }
    56        
     56
    5757        search->pattern_length = wstr_length(p);
    58        
     58
    5959        if (reverse) {
    6060                /* Reverse the pattern */
     
    6767                }
    6868        }
    69        
     69
    7070        search->pattern = p;
    71        
     71
    7272        search->client_data = client_data;
    7373        search->ops = ops;
     
    7878                return NULL;
    7979        }
    80        
     80
    8181        search->pattern_pos = 0;
    82        
     82
    8383        search->back_table[0] = -1;
    8484        search->back_table[1] = 0;
     
    100100                }
    101101        }
    102        
     102
    103103        return search;
    104104}
     
    107107{
    108108        search_equals_fn eq = s->ops.equals;
    109        
     109
    110110        wchar_t cur_char;
    111111        errno_t rc = EOK;
     
    128128                }
    129129        }
    130        
     130
    131131        match->end = NULL;
    132132        match->length = 0;
    133        
     133
    134134        return rc;
    135135}
     
    139139        free(search->pattern);
    140140        free(search->back_table);
    141        
     141
    142142}
    143143
  • uspace/dist/src/c/demos/edit/sheet.c

    r3061bc1 r8565a42  
    263263        coord.row = row;
    264264        coord.column = 65536;
    265        
     265
    266266        sheet_get_cell_pt(sh, &coord, dir_before, &pt);
    267267        spt_get_coord(&pt, &coord);
Note: See TracChangeset for help on using the changeset viewer.