Linux: Selection/cursor problems in RTL text #6458

mohammad-69 opened this Issue Jan 10, 2014 · 33 comments


None yet

4 participants

i'm a big fan of brackets . awesome job .
but there is a bug that make it unusable for me . when i want to edit a code like css or php of html code the crouser goes to the wrong place .
for example if i want to edit this tag : <a href:"">test</a> i should put crouser on ( /a> ) to be able to select the words , this problem is worst when i'm trying to write persian .
that's absolutely unusable for me .
the other problem is when i try to double click a word it do it in a wrong way . for example when i want to select and delete "test" from this code : <input id="test" > after double clicking and pressing delete result is : <input idl">

how can i fix this ? or would you guys patch it ?
thanks in advance


I'm pretty sure that your issue is similar to #6301 and is caused by some Persian text string before your sample html code. So can you provide the exact Persian text string that can cause the issue?

yeah it's the same problem this a screenshot from brackets that shows the crouser is 4 or 5 characher further than it's right position.


Can you paste the problematic text string in your description since we don't know how to type those strings?

for example this text :
این یک متن تست هست

or this one :

<title>ثبت مطالعه جدید

if you need just a word to work on it this is a simple word :

and this is an alphabet : ب


I can't reproduce the issue on mac. I believe you're on Linux as your screenshot shows Brackets menus in the editor area.

yes i'm using ubuntu 13.10 64 bit


Can you try it with CodeMirror demo page (like this one And report an issue in CM github if you can repro in the demo page. Please post the CM issue url here if you file one. Thanks.

look i've tested the codemirror text and i had the same issue with it , the crouser place was wrong . and double click .
persian alphabets are like arabians . so if there was a reported issue like this , can you guid me how to solve it ?


I would be happy to help you, but I'm not sure where the cursor should be when typing or moving the cursor with right/left arrow keys in Persian text string. That's why I was asking you to report an issue directly with CM. You should provide steps similar to the following sample so that others can see what is wrong. You also need to elaborate when you say "double click .
persian alphabets are like arabians".

Sample steps and result

1, Open in Chrome browser.
2, Paste این یک متن تست هست in the first line.

Result: The cursor shows up in the wrong position (further down to the right of the correct position).
Expected: The cursor should be right after xxx.

i have pasted این یک متن تست هست in codemirror the crouser is at the end of the sentence in persian .
i moved the cursor to the left and right and it was working ok in codemirror but i have problem with it on brackets it goes one charachter wrong for each word ,


Are you saying no issue with the cursor for pasting the sample text? Then, you need to describe how to get the issue after pasting.

yes in codemirror there is no issue but in brackets this is the problem for an alphabet :
the position that the cursor is right now is at the end of the alphabet and i can delete it right with this position .

this is a right place of cursor in gedit after typing س :


Good news. This seems to be fixed recently in CM and I can't reproduce it in master branch (that has recent updates from CM). So you can test it again when sprint 36 build is available sometime next week.

thanks for your help , i really appreciate it . i hope to see that the problem is fixed , because there is no good editor or ide for php and css & etc from my opinion except of brackets , but this issue make it unusable for me . thank you again and if i face the same problem can i post it here ?


Glad to hear that you like Brackets. Sure! I'll be closing this as fixed, but you can re-open it if you still can reproduce it in sprint 36 build.

@RaymondLim RaymondLim closed this Jan 10, 2014

hi I thought you said the cursor problem with persian alphabet will be fix in sprinit 36 but nothing has changed in sprinit 36 and the problem is still there . this is disappointing .

@mohammad-69 mohammad-69 referenced this issue in RaymondLim/BracketTest Feb 8, 2014

cursor problem with persian or arabic alphabets #1


@mohammad-69 Sorry to disappoint you by mistakingly claiming that it is fixed. Actually, the issue is still in CodeMirror but depending on how you test and which browser you use. Since I don't know the language, I have to rely on the sample code you provided. Again, it is also tricky since I'm copying and pasting to the editor. If there is a space at the end, the result is different. Anyway, I believe you should be able to reproduce it in the Chrome browser in So please log an issue in CodeMirror if you can reproduce it.

don't mention it , I reproduce the issue on CM and there wasn't any problem and it was ok!
this is what I created in CM :


این مقاله پزشکی است



I know because you don't know persian language It's hard to understand what is the problem , but i'll do what ever you need to understand the problem ,
in the third example in CM this one :


for example if you double click on "ب" you should be able to select it and be able to delete the alphabet , and if you move the cursor and place it here :

you can delete the alphabet with backspace key .

but in the brackets the place of cursor is different and it goes in the wrong place.


Thanks for your explanation of the issue. I clearly understand the issues in selecting Persian text with double-click and deleting it with backspace. But I just don't know how to reproduce the issues from your description. I did try your single character "ب" on an empty line and I didn't see any issue with selecting or deleting in Brackets. I think the real issue is not reproducible with just a single Persian character (no space characters before or after). Can you confirm a single character alone on one empty line does not reproduce the issue?

The issue is reproducible only if some RTL (right-to-left) characters are next to some LTR English characters as in the example of <p>ب</p>. With this example I can see two cursors when I set the cursor to the right (or left) of ب and I can see the cursor shows up after < in </p> when I move the cursor with right arrow key. Also deleting with backspace in this example can be confusing due to two cursors. Regarding double-clicking on the RTL characters, I can reproduce it in too. Can you confirm with this example in the demo page and report the issue in CM GitHub? Note that double cursor issue is also in the CM demo page and not just in Brackets.

Update: Regarding the cursor position issue, I can also reproduce it in the demo page with این یک متن تست هست.
Paste این یک متن تست هست on an empty line in the demo page. Then click to the right of the pasted text. The cursor shows up further to the right of the pasted text and leaving a large white space gap. And moving the cursor with left arrow key seems not moving to the right location in the text. Can you confirm this scenario and report this in CM also? Note that I can't reproduce this issue in Brackets, but only in CM demo page in a browser window.

thanks for your response , I have tested what ever you said . first : in brackets typing a single persian charachter like ب doesn't have any problem and with moving arrow keys you can simply delete it and also double click on it does not have any problem.
but as you said puting persian words between LTR charachers like این یک متن است is problem maker .
the other thing that I have tested was just typing persian charachters without any LTR charachters like : الفبپتثجچحخدالذالرزسینشین

while typing cursor went about 12 or 16 charachter further to the right . and also brackets put 12 or 16 spaces in the begining . the result was like the picture below :
cursor 123

the blue areas are about double clicking on the words . first line : double click was on : یک
the second line was on : این
the third line on : ب
the fourth line was double clicking on all charachters.

note: i have tried all of this examples in CM but i didn't face any problem .

can anyone solve this issue ?


@RaymondLim Sounds like we should reopen since it's not resolved yet. We could mark it 'tracking' if all the bugs are reported in CM already... or perhaps 'move to backlog' since RTL support is still in the icebox.

@peterflynn peterflynn reopened this Feb 20, 2014

Add Linux only label since all the issues illustrated in the above comment can be reproduced on Linux only.


Also, clarifying title (was very generic: "bug in editing")

so make the title RTL language support problem with cursor .and report it or consider it in the next version .
I hope sprint 37 don't have this bug in it and I be able to use brackets.
and on windows there is a bit problem with RTL support not that much like linux but it does have a few problems.

dangoor commented Feb 24, 2014

Reviewed medium priority (linux only)

I'm facing this problem on windows too why linux only ?

dangoor commented Feb 25, 2014

@mohammad-69 Sorry for not being clear about that... We have an item on our backlog to properly support RTL text. As part of that work, when we get to it, we would clear up the remaining troubles on Windows and Mac.

Currently, the Linux version of Brackets is largely supported by the community, so leaving this bug open with a "Linux only" label provides some extra visibility into this issue for the Brackets+Linux community.

@dangoor Ok , I hope you guys fix it soon . I can not use any other IDE or editor since I used brackets .


@mohammad-69 I can only reproduce it on Linux and I mentioned it in my previous comment. I used persian text you provided in your above comment, put it inside <label> tag as in your screenshot and I can select text or set cursor correctly on my Windows 7. Which Windows version you're using to reproduce it?

@RaymondLim I've tried both windows 7 and windows 8.1 . with one charachter you can not understand the problem it works normal but a word or sentence makes problem .

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