microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.36k stars 28.6k forks source link

Allow going inside graphemes (with an explicit gesture) #124954

Open dipu-bd opened 3 years ago

dipu-bd commented 3 years ago

Does this issue occur when all extensions are disabled?: Yes

Steps to Reproduce:

  1. Try to edit individual letters in this unicode string: '([ôঅইউঋএওআঈঊঐঔ])'
  2. The entire ô part is grouped together.

Initial cursor position:

image

After shifting cursor one time:

image

alexdima commented 3 years ago

@dipu-bd I get the same behavior in Chrome, for example in GitHub's comment input.

VS Code implements Unicode's grapheme cluster boundary rules as specified here -- http://www.unicode.org/reports/tr29/#Grapheme_Cluster_Boundary_Rules

So I believe we are doing the correct thing here.

dipu-bd commented 3 years ago

From an user's perspective, code editors should allow editing any form of text down to miniscule letters. For workaround, I am copy pasting the edited text into vscode. But it is frustrating to not be able to code as I wish in my favorite editor.

The vscode terminal seems to be able to handle these characters separately.

alexdima commented 3 years ago

From an user's perspective, code editors should allow editing any form of text down to miniscule letters.

VS Code does this if you press backspace. But VS Code does not allow you to "go inside" a grapheme. This is consistent with the Unicode standard and other Unicode compliant text or code editors.

The vscode terminal seems to be able to handle these characters separately.

The vscode terminal does not implement the Unicode grapheme cluster boundary rules.

dipu-bd commented 3 years ago

Is there any way to turn off Unicode compliancy through some settings? I really need this option.

dipu-bd commented 3 years ago

I can edit these graphemes in IntelliJ IDEA

image

Atom also follows the unicode grapheme standard. But it does not attach the all letters with the previous non-grapheme character. See in the picture below that I can put the cursor after ô

image

It is true that browsers like Chrome behaves exactly like vscode. But should it? vscode is not a browser. My point is vscode does not need to display characters as beautiful as possible. Instead it should focus on allowing developers more control and freedom.

m33b00 commented 2 years ago

Any update on this? I am facing the same issue.

alexdima commented 2 years ago

@m33b00 The only workaround I'm aware of is to use F1 > Go To Line/Column and then input a position that would be inside the grapheme.