aboutsummaryrefslogtreecommitdiffhomepage
path: root/reader.h
diff options
context:
space:
mode:
authorGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-26 00:41:30 -0800
committerGravatar ridiculousfish <corydoras@ridiculousfish.com>2014-01-26 00:41:30 -0800
commitf58dff62c7888ec00f0c10e27b46c1347ecb85d3 (patch)
treed61f2cadea8b32e9ddff73162d507be69f66fb57 /reader.h
parent6d13b8bbc0a797bd1403c3084c6152480c98ace4 (diff)
Beginnings of work for search field feature of new pager
Diffstat (limited to 'reader.h')
-rw-r--r--reader.h36
1 files changed, 36 insertions, 0 deletions
diff --git a/reader.h b/reader.h
index 82694e21..cf8d5043 100644
--- a/reader.h
+++ b/reader.h
@@ -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
*/