payload: {"action":"opened","issue":{"url":"https://api.github.com/repos/typora/typora-issues/issues/2271","repository_url":"https://api.github.com/repos/typora/typora-issues","labels_url":"https://api.github.com/repos/typora/typora-issues/issues/2271/labels{/name}","comments_url":"https://api.github.com/repos/typora/typora-issues/issues/2271/comments","events_url":"https://api.github.com/repos/typora/typora-issues/issues/2271/events","html_url":"https://github.com/typora/typora-issues/issues/2271","id":421382216,"node_id":"MDU6SXNzdWU0MjEzODIyMTY=","number":2271,"title":"Cursor movement between WYSIWYG/expanded modes","user":{"login":"beorn","id":8559,"node_id":"MDQ6VXNlcjg1NTk=","avatar_url":"https://avatars1.githubusercontent.com/u/8559?v=4","gravatar_id":"","url":"https://api.github.com/users/beorn","html_url":"https://github.com/beorn","followers_url":"https://api.github.com/users/beorn/followers","following_url":"https://api.github.com/users/beorn/following{/other_user}","gists_url":"https://api.github.com/users/beorn/gists{/gist_id}","starred_url":"https://api.github.com/users/beorn/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/beorn/subscriptions","organizations_url":"https://api.github.com/users/beorn/orgs","repos_url":"https://api.github.com/users/beorn/repos","events_url":"https://api.github.com/users/beorn/events{/privacy}","received_events_url":"https://api.github.com/users/beorn/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-03-15T07:10:54Z","updated_at":"2019-03-15T07:10:54Z","closed_at":null,"author_association":"NONE","body":"**TLDR; There are some surprises (read usability issues) when moving from WYSIWYG mode into markdown-code-expanded mode, especially when using cursor movements, and these can be alleviated by moving the cursor insertion point to a location that would be more consistent with the WYSIWYG view, not the markdown code view.  Furthermore, it's not handled consistently across links and headlines, for example.** \r\n\r\nI have a suggestion that would at least make editing link text more intuitive for me.  Let’s say you have a link (markdown code expanded) as follows:\r\n\r\n\tThis [a link](http://actual.link.com/) to somewhere.\r\n\r\nwhich will render (in WYSIWYG mode) as:\r\n\r\n  **This is _a link_ to somewhere.**\r\n\r\nIf you click inside of the link title the cursor will be positioned into the link title, as expected (and the markdown code will be expanded, which I don't have a problem with).\r\n\r\nIf, however, you were moving the cursor to the left from the **to somewhere** into the **_a link_**, the markdown code is shown and the cursor appears to jump to a different location (outside of the link location) then what you saw just a moment ago.  While I can understand this from a “you are editing markdown code” point-of-view, I think it’s a bit suboptimal if you consider the WYSIWYG point-of-view:\r\n\r\n1) If you imagine a WYSIWYG editor, you’d expect to be positioned to edit the **_a link_** text.\r\n2) It would better match the pointer-tapping behavior.\r\n3) Multiple delete events (delete or backspace) destroys the markup symbols instead of the text (which gives confusing results).\r\n4) It’s probably much more common to edit link text, so it would make sense to optimize for that.\r\n5) Accidental edits of actual links (which can be quite cryptic) tend to be harder to notice (only way is to click on them, and even then you couldn’t be sure) than accidental edits of link texts (which are obvious).\r\n6) This would make it consistent with how cursoring into some other markdown code sections, such as headlines (```#``` etc) works.  If you move the cursor to the right into a headline it’ll position the cursor to the left of the text, not to the left of (outside of) the markdown code.\r\n\r\nI think a potentially better behavior is this:\r\n\r\n  - If you’re outside of the link so it’s rendered WYSIWYG (not expanded)\r\n    - If you move to the left from “to somewhere” you would jump directly to the right of “a link” after expanding the markdown code\r\n    - If you move to the right from “This is” you would jump directly to the left of “a link” after expanding the markdown code\r\n\r\n  - With the markdown code expanded, however, you can:\r\n    - Use the cursor to move into the link itself and edit it\r\n    - Delete/edit the brackets (since you can see them)\r\n\r\nSo any accidental deletes/backspaces from outside the link into the link would impact the link text, not the actual link.\r\n\r\nThe dual WYSIWYG/markdown-code modes of Typora is a cool & unique feature of the editor, but it comes with some compromises.  I think the above changes will improve usability, perhaps alleviating some other complaints too as an alternative to removing this duality and go completely WYSIWYG with popups (refs #1317)."}}
other: {"actor":{"display_login":"beorn"}}