Changeset cedd33b in mainline for uspace/app/bdsh/input.c


Ignore:
Timestamp:
2009-12-05T17:35:57Z (14 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bc77bfa
Parents:
f1b37d6
Message:

Cut (Ctrl-X) and select all (Ctrl-A).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • uspace/app/bdsh/input.c

    rf1b37d6 rcedd33b  
    9090static void tinput_sel_get_bounds(tinput_t *ti, int *sa, int *sb);
    9191static bool tinput_sel_active(tinput_t *ti);
     92static void tinput_sel_all(tinput_t *ti);
    9293static void tinput_sel_delete(tinput_t *ti);
    9394static void tinput_key_ctrl(tinput_t *ti, console_event_t *ev);
     
    255256        size_t off;
    256257
    257         ilen = min(str_length(str), INPUT_MAX - ti->nc);
     258        ilen = min((ssize_t) str_length(str), INPUT_MAX - ti->nc);
    258259        if (ilen == 0)
    259260                return;
     
    477478}
    478479
     480static void tinput_sel_all(tinput_t *ti)
     481{
     482        ti->sel_start = 0;
     483        ti->pos = ti->nc;
     484        tinput_display_tail(ti, 0, 0);
     485        tinput_position_caret(ti);
     486}
     487
    479488static void tinput_sel_delete(tinput_t *ti)
    480489{
     
    654663                tinput_seek_vertical(ti, seek_forward, false);
    655664                break;
     665        case KC_X:
     666                tinput_sel_copy_to_cb(ti);
     667                tinput_sel_delete(ti);
     668                break;
    656669        case KC_C:
    657670                tinput_sel_copy_to_cb(ti);
     
    659672        case KC_V:
    660673                tinput_paste_from_cb(ti);
     674                break;
     675        case KC_A:
     676                tinput_sel_all(ti);
    661677                break;
    662678        default:
Note: See TracChangeset for help on using the changeset viewer.