typora / typora-issues

Bugs, suggestions or free discussions about the minimal markdown editor — Typora
https://typora.io
1.53k stars 58 forks source link

Problem with keyboard navigation & cursor #1164

Open mprinc opened 6 years ago

mprinc commented 6 years ago

Hi,

I have a nasty problem with keyboard navigation

let say this is a text: `hello this is a text'

  1. i position cursor (mouse, keyboard) in front of the `is'
  2. use SHIFT+CMD+<right-arrow-key> to reach the most right (behind the text) - should be selected is a text (correct)
  3. use SHIFT+CMD+<left-arrow-key> to move one word before the end - should be selected is a (including ending ). unfortunately, typora instead of moving the right side of the selection it moves the left side of the selection

I have a lot of trouble with this, need to use character-level navigation instead of word-level, or destroying selections, mistakes, , ..

AlexPasternak commented 6 years ago

I think some characters got lost in above, but I see the issue @mprinc means. The behavior is different from TextEdit when it comes to adjusting the selection.

After expand selection to end of text:

mprinc commented 6 years ago

Thanks.

Well, I would say that on other editors it is consistent:

  1. if I ended up with my cursor on the right edge of selection then next motion will affect the right edge, and vice versa:
  2. if i ended up with my cursor on the left edge of selection then next motion will affect the left edge

This is true for typora for the 2nd case but fails for the 1st case

abnerlee commented 6 years ago
dialex commented 6 years ago

I have version 0.9.9.17.4 and the issue is still there.

It makes me very unproductive with the keyboard, which is the whole point of a text editor. It's infuriating that sometimes it makes me rage quit Typora and use another editor like VisualStudio Code. It's uglier but "it just works" ☚ī¸

@abnerlee Please fix this 🙏

hitzhangjie commented 5 years ago

I came across same problem today, I changed the theme from github to quartz-milky. When I position the cursor at the heading, pressing shift+command+left will select all text before cursor.

After I commented out theses lines of css code of theme quartz-milky, typora works well, selection bug disappears.

image

Hope this can help to locate the bug.

############

Append something:

   h1::before,                                                                            
   h2::before,                                                                            
   h3::before {
     font-weight: 400;
     text-align: right;
     width: 5ch;
     padding-right: 1ch;
     margin-left: -5ch;
     color: var(--accent-color);
     /*display: inline-block;*/                                                                                                                                                      
   }

   h1::before {
     content: '#';
   }

inline-block won't put a line-break after the element, this was the cause. typora select should take the raw content into consideration, also the rendered one, it's difficult? rendering result maybe different.

####### change css display property, using following instead, it works:

   h1::before,                                                                            
   h2::before,                                                                            
   h3::before {                                                                           
     font-weight: 400;                                                                    
     /*text-align: right;*/                                                               
     /*width: 5ch;*/                                                                      
     /*padding-right: 1ch;*/                                                              
     /*margin-left: -5ch;*/                                                               
     color: var(--accent-color);                                                          
     /*display: inline-block;*/                                                           
     position: absolute;                                                                  
     right: calc(100% + 10px);                                                                                                                                                       
   } 
mustafa0x commented 5 years ago

Right/left arrow keys are very buggy in RTL texts.

For example, if the cursor is at the end or beginning of a line, then you become stuck, and right and left arrow keys simply move you up then down endlessly.

zzz

nathancarter commented 4 years ago

This issue is pretty important, because the application is a text editor, and many of us have deeply-ingrained muscle memory for editing text with the keyboard. Typora repeatedly punishes that muscle memory, which is an unpleasant experience. It is literally the only application I use that has this nonstandard cursor behavior.

munkychop commented 4 years ago

This is still an issue as of version 0.9.9.35.2 (4715). I really like Typora, but this bug makes me consider switching to another editor. Would love to see it fixed.

Specific reproduction steps:

Given text: abc def ghi

  1. Put the cursor between the d and e characters
  2. Press and hold shift+cmd
  3. Press the right arrow, which highlights ef ghi
  4. Release the cmd key, but continue holding the shift key
  5. Press the left arrow

Expected result: ef gh should be highlighted

Actual result: def ghi is highlighted

jaekyeom commented 3 years ago

Version 0.11.5 (5648), and this is still an issue.

typoraselection

dialex commented 2 years ago

I can confirm it still happens on v1.0.5. The issue has 4 years already. Now that Typora is out of alpha and I paid for it, it stings a little more everytime I face this issue 💔 Please consider fixing it @abnerlee. You might feel like it's an irrelevant bug but I assure you, this breaks the writting flow -- and no one wants that in a text editor.

Let us know if we can help in any way 🙏

nathancarter commented 2 years ago

Yeah. Basic text editing bug open for 4 years = I'm no longer using Typora.

dialex commented 1 year ago

Please @abnerlee, don't forget about this issue đŸ˜ĸ

yshalsager commented 1 year ago

The issue still exists even in the latest v1.6.6 version. So disappointing.