KristofferC / OhMyREPL.jl

Syntax highlighting and other enhancements for the Julia REPL
https://kristofferc.github.io/OhMyREPL.jl/latest/
Other
746 stars 57 forks source link

Indentation of continuation lines broken when using non-standard input prompt #315

Closed mgkurtz closed 1 year ago

mgkurtz commented 1 year ago

Using a custom input prompt, multi-line input is shown misaligned, but the cursor is at the position, where it should be, if all were well-aligned. This turns me quite mad :face_with_spiral_eyes:

julia> OhMyREPL.input_prompt!("∴> ")

∴> """
   █   abc
       """

The depicts where the cursor appears, when it is at the beginning of the second line, i.e. where a <Delete> will delete the a.

According to git bisect this bug was introduced with 1bc0e5b7ec9e1a9b294e0ffc5ff651a2294a69e1. Before that, I got

julia> OhMyREPL.input_prompt!("∴> ")

∴> """
   abc
   """

with cursor and display aligning correctly.

The bug appears with prompts of all lengths, but the default one.

KristofferC commented 1 year ago

Thanks for the report and the bisect. I'll try figure out where the divergence between the old tokenizer and the new one is.

dhanak commented 1 year ago

I confirm that this is broken. Downgrading OhMyREPL to v0.5.17 solves the issue.

(Also note that v0.5.18 is broken, it doesn't compile.)

KristofferC commented 1 year ago

I'm guessing https://github.com/KristofferC/OhMyREPL.jl/issues/313 is a dup of this then.