Skip to content

Python REPL gives an error when sending code containing a string that ends with 'r' #339

Open
@gboehl

Description

Describe the bug
If a line contains a string ending with 'r', 'R', "r" or "R" (that is, any string ending with the letter "R"), neoterm appends an additional ' or " to the end of the line when sending it to the repl. This (not surprisingly) creates a syntax error in python.

To Reproduce
Steps to reproduce the behavior:

  1. Opened a neoterm python REPL
  2. Send "r"
  3. receive
In [1]: "r"'
  Input In [1]
    "r"'
       ^
SyntaxError: unterminated string literal (detected at line 1)

Expected behavior
Something along the lines of

In [2]: "q"
Out[2]: 'q'

Versions (Issues without this information will take longer to be answered/solved):

  • OS: Arch Linux
  • neoterm installed via Vundle
  • Add all the configuration you have for neoterm

let g:neoterm_default_mod='belowright'
let g:neoterm_size=12
let g:neoterm_autoscroll=1

- Vim or Neovim
- [ ] vim
- [x] neovim
- Version v0.6.1

Additional context

This really only seems to happen when r is the last member of a string (like in 'star'), not for any other letter or number.

I noticed that input 'r' get send as "r"' (with a ' at the end, but the original ' gets translated to ") while for "r" the REPL receives "r"" (with a " at the end).

Thanks for this nice piece of software!

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions