We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I'm trying to insert multi-line code snippet, e.g:
res = {} for i=1,5 do table.insert(res, 1) end
and i get this:
end
but buffer is valid — if i press enter key, code execute normally.
Correct display of the code snippet.
I looked at the source code, and it said that \n translates to \r. After that, I tried to make my Ctrl-V handler like this:
\n
\r
Key: prompt.ControlV, Fn: func(buf *prompt.Buffer) { text := buf.Text() buf.DeleteBeforeCursor(len(text)) buf.InsertText(strings.Replace(text, "\r", "\n", -1), false, true) }
but in this case, Render update screen invalid and i get (for every keystroke, e.g changing the cursor keys: left, right) something like this:
myapp.s1-master> res = {} for i=1,5 do table.insert(res, 1) myapp.s1-master> res = {} for i=1,5 do table.insert(res, 1) myapp.s1-master> res = {} for i=1,5 do table.insert(res, 1) myapp.s1-master> res = {} for i=1,5 do table.insert(res, 1) myapp.s1-master> res = {} for i=1,5 do table.insert(res, 1) myapp.s1-master> res = {} for i=1,5 do table.insert(res, 1) end
looking at the source code (render.go), I realized that at the moment only single lines are supported :(
The text was updated successfully, but these errors were encountered:
I found a fork that solves this issue: https://github.com/binaek89/go-prompt
Sorry, something went wrong.
fix for multiline rendered mess up.
485955c
this is ported from here. binaek@7e13943 bug detail: c-bata#227
25a206e
No branches or pull requests
Bug reports
I'm trying to insert multi-line code snippet, e.g:
and i get this:
end
but buffer is valid — if i press enter key, code execute normally.
Expected Behavior
Correct display of the code snippet.
Details
I looked at the source code, and it said that
\n
translates to\r
.After that, I tried to make my Ctrl-V handler like this:
but in this case, Render update screen invalid and i get (for every keystroke, e.g changing the cursor keys: left, right) something like this:
looking at the source code (render.go), I realized that at the moment only single lines are supported :(
The text was updated successfully, but these errors were encountered: