New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Indenting word wrapped lines while editing? #352

Open
virtuallyvlad opened this Issue Oct 17, 2018 · 3 comments

Comments

Projects
None yet
2 participants
@virtuallyvlad

virtuallyvlad commented Oct 17, 2018

Can any of the editors indent word wrapped lines while in edit mode?

Meaning, if you start a line indented and it ends up wrapping to the next line, the next line is indented the same amount (or, optionally, one level more).

I only saw this feature in the preview/view modes of a couple, whereas most desktop notepads allow this while editing. E.g., Notepad++ calls it "Aligned Line Wrap" or "Indent Line Wrap", and Notepad2 allows you to "Wrap indent as first subline" or "Wrap indent 1 level more than first subline".

It's a feature that really improves the legibility and organization of a note when applying hierarchical or nested indentation. I think it's also relatively common for code in order to see logical structures more easily.

@mobitar

This comment has been minimized.

Member

mobitar commented Oct 18, 2018

You might check the Code Editor, Vim Editor, or Minimal Markdown Editors for this. If they aren't supported in any of those, it's unlikely we'll add them, unless you can find some documentation for CodeMirror that states this would be possible.

@virtuallyvlad

This comment has been minimized.

virtuallyvlad commented Oct 18, 2018

Thanks for the reply. I do not see any of those three indenting wrapped text.

I checked the others again and these do it but in preview mode only:

  • Simple Markdown Editor
  • Fancy Markdown Editor
  • Advanced Markdown Editor

There is this CodeMirror demo which does it by changing the renderLine event:
https://codemirror.net/demo/indentwrap.html

And another CodeMirror demo which uses the above and also detects "-", ">", "1." as part of identation:
https://codepen.io/cben/pen/JdKyRE

Just for reference, there are also other embedded javascript editors with this: Ace, Atom, and Brackets (based on CodeMirror). Understood that another Extension is probably not the highest priority :)

@mobitar

This comment has been minimized.

Member

mobitar commented Oct 19, 2018

Thanks, I'll check this out when I get the chance. If you happen to find a working solution, feel free to submit a PR to any of the editors, located here.

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