Can't print string with '\n' in python
dylan-chong opened this issue · comments
If you only have a quick question, consider posting it on the Gitter.
Otherwise, please include the following:
Issue description
-
Brief description - Trying to string with multiple lines
-
Expected results - when i try to print the string with the
\n
s in it, all of the lines should be shown -
Actual results - when i try to print the string with the
\n
s in it, only the last line is shown -
A minimal
.vimrc
that will reproduce the issue - Hopefully this isn't actually needed i will supply this if needed -
Exact steps to reproduce te issue, starting with the command used to open
vim
- Open codi while in a python file
- Type a string with multiple lines for example
print 'a\nb'
. You will only see the last line in the output
-
If it's not too much trouble, a screencast (e.g. asciinema) of the issue - Hopefully not needed
Environment
- Operating system - mac 10.13.5 (17F77)
- Version of
script
(if you don't know, just paste the last line of the
man page) - The following in a pastebin, to reduce visual clutter: https://pastebin.com/pk9FNcTt
- Entire output of
vim --version
- Log lines (see
:h g:codi#log
)
- Entire output of
What I'm essentially trying to do in the above example is generate a list of test cases to pass into my function. I'm not sure if this is a valid use case of this plug-in, but would be useful nonetheless.
Another possible use case is you want to generate an output with multiple lines, for example pretty printed Json. If you could only see the last line of the Json, it would be not very useful
I am wondering about whether showing the result side-by-side for each line is actually possible, since showing a multiple line output would shift the results below. I'm sure you are aware of this
Another problem is where a string or some output is too long and so wraps onto a new line.
This is working as intended; if the output is longer than a line, then it's impossible to correctly line up the left half with the right half. However, the line wrapping shouldn't be happening because the output pane should have nowrap
set. Is something in your .vimrc
unsetting that?
I intentionally turned off no wrap because I wanted to see the rest of the output
I see. Everything is working as intended, then; I think you'll have to pursue another way to achieve your desired result, because Codi isn't built for this use case.
Just a thought, what about showing all lines of output for the last line?