metakirby5 / codi.vim

:notebook_with_decorative_cover: The interactive scratchpad for hackers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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 \ns in it, all of the lines should be shown

  • Actual results - when i try to print the string with the \ns 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

    1. Open codi while in a python file
    2. Type a string with multiple lines for example print 'a\nb'. You will only see the last line in the output
  • Any relevant screenshots screen shot 2018-06-30 at 10 51 29 pm
    screen shot 2018-07-01 at 10 07 39 am

  • 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)

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.

screen shot 2018-07-01 at 10 11 33 am

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?