diff options
author | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-26 00:41:30 -0800 |
---|---|---|
committer | ridiculousfish <corydoras@ridiculousfish.com> | 2014-01-26 00:41:30 -0800 |
commit | f58dff62c7888ec00f0c10e27b46c1347ecb85d3 (patch) | |
tree | d61f2cadea8b32e9ddff73162d507be69f66fb57 /reader.h | |
parent | 6d13b8bbc0a797bd1403c3084c6152480c98ace4 (diff) |
Beginnings of work for search field feature of new pager
Diffstat (limited to 'reader.h')
-rw-r--r-- | reader.h | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -22,6 +22,42 @@ class parser_t; class completion_t; class history_t; +/* Helper class for storing a command line */ +class editable_line_t +{ + public: + + /** The command line */ + wcstring text; + + /** The current position of the cursor in the command line */ + size_t position; + + const wcstring &get_text() const + { + return text; + } + + /* Gets the length of the text */ + size_t size() const + { + return text.size(); + } + + bool empty() const + { + return text.empty(); + } + + editable_line_t() : text(), position(0) + { + } + + /* Internal */ + void kill(size_t begin_idx, size_t length, int mode, int newv); + +}; + /** Read commands from \c fd until encountering EOF */ |