- draw_input_line: function() {
- terminal.drawBox(terminal.rows - 1, terminal.cols / 2, 1, terminal.cols / 2);
+ add_to_input: function(str) {
+ if (this.input.length + str.length > this.window_width * terminal.rows) {
+ return;
+ }
+ this.input += str;
+ this.recalc_input_lines();
+ },
+ recalc_input_lines: function() {
+ this.input_lines = this.msg_into_lines_of_width("> " + this.input, this.window_width);
+ this.height_input = this.input_lines.length;
+ },
+ shorten_input: function() {
+ this.input = tui.input.slice(0, -1);
+ this.recalc_input_lines();
+ },
+ draw_input: function() {
+ terminal.drawBox(terminal.rows - this.height_input, this.window_width, this.height_input, this.window_width);