File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -4,8 +4,8 @@ local Prompt = require("terminal.cli.prompt")
4
4
local pr = Prompt {
5
5
prompt = " Enter something: " ,
6
6
value = " Hello, 你-好 World 🚀!" ,
7
- max_length = 262 ,
8
- position = 2 ,
7
+ max_length = 62 ,
8
+ -- position = 2,
9
9
cancellable = true ,
10
10
text_attr = { brightness = " high" },
11
11
}
Original file line number Diff line number Diff line change @@ -217,6 +217,12 @@ function Prompt:draw()
217
217
self .prompt , -- prompt
218
218
function () return t .text .stack .push_seq (self .text_attr ) end , -- push text attributes
219
219
l , -- all lines concatenated (we formatted using padding, so should properly wrap)
220
+ function ()
221
+ if # self .current_lines > 1 and self .current_lines [# self .current_lines ]:len_char () == 0 then
222
+ return " \n " -- last line is just for cursor (empty line), case not handled by the padding, insert newline
223
+ end
224
+ return " "
225
+ end ,
220
226
t .text .stack .pop_seq , -- pop text attributes
221
227
t .clear .eol_seq (), -- clear the rest of the last line
222
228
t .cursor .position .column_seq (self .cursor_col ), -- move cursor to proper column
You can’t perform that action at this time.
0 commit comments