Open novoselt opened 1 month ago
This is what CodeMirror 5 does (see, e.g., this demo on their site: https://codemirror.net/5/demo/indentwrap.html). See https://github.com/sagemathinc/cocalc/issues/5401 for discussion about switching to CodeMirror 6, which is what JupyterLab uses.
Dupe of #5401 unless there is a configuration option for codemirror 5 to change this behavior (I didn't see one at https://codemirror.net/5/doc/manual.html#config, but there's a lot of options). You might also consider disabling line wrapping in your account prefs, if you don't want line wrapping.
For the arbitrariness of this behavior, I'll quote a random person on redit "The standard Home/End behavior has always been different on the Mac than in Windows, dating back to the 80s."
For the record, my personal preference is probably what you're asking for. It also aligns with what Slate wyswiyg editing does. I just think it's something that is inherited from the choice of editor, hence #5401 .
Incidentally VS Code has the behavior you want -- just open a markdown file and line wrapping is ON by default, and it doesn't wrap by default.
Why did you have to point this out? Now it is driving me crazy whenever I edit text in codemirror!
Describe the bug A the moment Home/End operate on file lines/paragraphs.
To Reproduce Steps to reproduce the behavior:
Expected behavior I have never seen such a behaviour in any other editor. JupyterLab and VS Code launched from CoCalc operate on displayed lines (although VS Code has wrapping off by default, eliminating the chance of this problem).
This is of little consequence for editing code, which should have short enough lines to be readable. But when one writes plain prose, file lines correspond to paragraphs and can be quite long, so it makes little sense to jump to their start/end instead of start/end of the line that I see as being edited in front of me.