arduino / lab-micropython-editor

Arduino Lab for MicroPython is an Integrated Development Environment (IDE) for MicroPython.
GNU Affero General Public License v3.0
218 stars 29 forks source link

Apostrophes not buffered correctly in combination with special character in REPL #27

Closed StevenCellist closed 5 months ago

StevenCellist commented 1 year ago

In most languages, characters like ' and " are buffered until a second character has been typed. The REPL however buffers these incorrectly: typing either of these two, followed by another special character, results in that special character rendered twice instead of rendering the apostrophe and special character.

Example: typing "] results in ]], unless specifically entering after the apostrophe.

ubidefeo commented 1 year ago

hey @StevenCellist I tried to figure out what you mean but to be honest haven't been able to understand

StevenCellist commented 1 year ago

Hey @ubidefeo, thanks for following this up! I hope I can be clear enough.

An example: typing the following in the Terminal

x["test"]

... results in ...

x["test]]

This only happens on a keyboard-language which buffers the " for use in e.g. ä and ë.

An example is the Dutch (NL) keyboard.

Hope that helps!

ubidefeo commented 1 year ago

hey @StevenCellist

I cannot reproduce that one on Mac. Even using combinations of ALT and '`' to add a modifier of following character it won't happen. What OS are you on?

StevenCellist commented 1 year ago

Windows; I have tried it on multiple machines and v0.6 has the same problem on my pc.

murilopolese commented 1 year ago

I can't reproduce either. I'm on a linux machine with Swedish keyboard.

Image

One thing to take in consideration is that the console/repl itself is not part of the editor. The source code and character parsing happens inside the board, by the micropython firmware. All that the editor does is to pipe the keystrokes through serial exactly the way they are being captured by the javascript listeners.

I would recommend trying to type the same thing with another software such as screen or another serial monitor to see if the problem is with the javascript. If you are typing a combination of keys to input " the problem may be out of our reach :T

ubidefeo commented 1 year ago

@StevenCellist we have completely reworked the escape/encode part of the save/upload workflows. The bug will be fixed in upcoming 0.8.0

ubidefeo commented 5 months ago

Closed for non-reproducibility and staleness