Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weird behavior inserting parentheses on Norwegian keyboard #235

Open
teodorlu opened this issue Oct 14, 2020 · 10 comments
Open

Weird behavior inserting parentheses on Norwegian keyboard #235

teodorlu opened this issue Oct 14, 2020 · 10 comments

Comments

@teodorlu
Copy link

Issue: Weird behavior inserting parentheses on Norwegian keyboard

Hello! Thanks for creating Maria. Seeing how smooth the experience is has motivated me to dig into Clojurescript.

I'm observing weird behavior trying to insert parentheses on my Norwegian keyboard:

  • Pressing Shift+8 to insert ( inserts (
  • Pressing Shift+9 to insert ) inserts ()

I suspect keyboard differences and keycode usage might be to blame. I haven't dug into the issue, but I thought I'd report it.

Have a nice day!

Environment:

  • Browser: Firefox
  • Platform: Ubuntu 20.04

Also observed on Chrome / Mac with a Norwegian keyboard layout.

@teodorlu
Copy link
Author

Here's console-logged keydown events for pressing Shift+8 and Shift+9 on my keyboard:

image

@daveliepmann
Copy link
Collaborator

Thanks for reporting, Teodor :)

@jackrusher
Copy link
Collaborator

@teodorlu Thanks for the report! Sadly, we have had an endless struggle with different KB layouts. :/

@teodorlu
Copy link
Author

teodorlu commented Oct 14, 2020

I can imagine!

I tried poking around a bit, but I don't feel like I'm getting anywhere. The input fields appear to be using CodeMirror. Codemirror's native Clojure mode handles parentheses on Norwegian keyboards as expected. Maria, however, appears to be using Lark for paredit. Relevant namespaces: maria.editors.code and lark.commands.exec.

@berndbausch
Copy link

Is it OK to comment on a 3 years old issue? I have exactly the same problem with Japanese layout, where the parentheses are on the same 8 and 9 keys as in Norwegian. It's great to have a good workaround; switching to a US-English keyboard layout is easy enough for me.

And yes, thanks for maria.cloud!

@mhuebert
Copy link
Owner

Hello! Could you try out 2.Maria.cloud and let us know how it behaves? It has a new key binding system

@sushito
Copy link

sushito commented Oct 24, 2023 via email

@berndbausch
Copy link

berndbausch commented Oct 25, 2023

Hello! Could you try out 2.Maria.cloud and let us know how it behaves? It has a new key binding system

With pleasure.

With my Japanese keyboard setting, I observed the following:

  • When I enter an opening parenthesis, a closing one is immediately added (resulting in ()), but I have no problems removing the closing one.
  • Weird but not totally devoid of logic: A backspace over a closing parenthesis leaves the parenthesis unchanged, as if it were a mere cursor movement.
  • It seems that a closed parenthesis is ignored when typed directly after white space.
  • Sadly, Control-Enter has no effect. Totally ignored.

The Japanese keyboard layout is, by the way, very similar to the US English one, even when it comes to some often used symbols like slash, question mark, hyphen. Parentheses (round, square, curly) are in slightly different locations.

Trying to attach a video file that documents the behaviour; hope it works: https://github.com/mhuebert/maria/assets/11023294/107f0d04-3b21-4007-b13c-acc291677463 (I just noticed that I forgot the location parameters of the position function, but that is unlikely to be related to the problem).

I have some time right now and would be happy to do more testing.

@teodorlu
Copy link
Author

teodorlu commented Oct 25, 2023

On 2.maria.cloud right now with a Norwegian mac keyboard, I'm seeing the following:

  1. æøåÆØÅ does what I expect it to do
  2. ( works, and inserts ( and matching )
    • I insert ( on my keyboard with shift+8
  3. [ only inserts opening [, not closing ]
    • I insert [ on my keyboard with option+8

@teodorlu
Copy link
Author

teodorlu commented Oct 25, 2023

Found another surprising behavior:

image

When I write (last [1 2 3]) and press cmd+enter, I can't get it to evaluate. It just says nil.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants