parinfer-rust-mode icon indicating copy to clipboard operation
parinfer-rust-mode copied to clipboard

Issue when insert space after some non-ASCII char.

Open nasyxx opened this issue 3 years ago • 2 comments

Hi, I meet this issue with the indent and smart modes.

| indicates the cursor. The can be any CJK/emoji/...

(func 中|)

After hit SPC,

Except:

(func 中 |)

Actually

(func 中)|

But if it is an ASCII char

(func a|)
;; ->
(func a |)

According to my observation, if I yank a space after , it is feasible, works as the ASCII char.

(func 中|)
;; yank a space->
(func 中 |)

So, is it possible to avoid this issue?

nasyxx avatar May 05 '21 04:05 nasyxx

Hi thanks for pointing this out. It is not ideal. 🙁

Unfortunately, with a cursory glance, this appears to be an issue in the library that parinfer-rust-mode uses. The author has made a note of it here, but not much progress has been made.

I'm going to try and find some time to validate that this isn't an emacs/implementation issue, but as of right now I wouldn't hold my breath.

Yank can work, because I have special code to handle yanks and treat every yank operation as being in paren-mode. Note how you can yank one space, but if you then try to insert a second space through conventional means it skips over the bracket like in your examples.

justinbarclay avatar May 05 '21 05:05 justinbarclay

Hi, thank you very much for your explanation and tips.

At present, I have added (quoted-insert . "parn") to parinfer-rust-treat-command-as, and then C-q SPC will input SPC after these characters.

nasyxx avatar May 06 '21 19:05 nasyxx