Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Editor: have cursor remember position when switching between Visual and HTML #8592
Steps to reproduce
What I expected
That the cursor would be at the position it was when I switched editors, so I can easily edit the relevant section's HTML
What happened instead
The cursor jumped to the top of the post, meaning I'd have to search again for the section I need to edit.
Browser / OS version
Happens across browsers and OS's
Screenshot / Video
Context / Source
This was reported by a user via Twitter. In very long posts or posts with complex HTML formatting the current behaviour leads to a very cumbersome editing experience. Making the cursor "stick" when switching editors can make a big difference to users who regularly edit content using both views.
Edited to add: The highlighting in the video is just for emphasis. The cursor jumps to the top regardless of whether text is highlighted or not.
I call this #scroll-scan-correlate flow.
I also experience this in media pickers that don't provide images accessible to my presbyopic eyes. Scroll, scan, correlate is physically and mentally tedious and smashes my cognitive stack. I'll forget what I was doing while doing the scan-and-correlate context gymnastics.
I am glad I can insert images in HTML mode because that gives me more control over where they actually appear. (Images I insert in Visual mode often must be moved in HTML mode.) On the other hand, I always want to override the default alignment. If I am not sure how to tweak the HTML attributes directly, I can switch to the Visual tab. But I need to find the image again on the Visual tab. I realize that it would be tough to maintain a tight correlation between editing cursor positions on the HTML and Visual tabs, but it would be helpful if the cursor position in one tab could be *approximated* when switching to the other.