+ 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);
+ if (this.mode == 'chat' || this.mode == 'annotate') {
+ for (let y = terminal.rows - this.height_input, i = 0; y < terminal.rows && i < this.input_lines.length; y++, i++) {
+ terminal.write(y, this.window_width, this.input_lines[i]);
+ }
+ }
+ },
+ msg_into_lines_of_width: function(msg, width) {