Skip to content
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

Use Emacs style hard wrapping. #1

Merged
merged 14 commits into from
Jun 21, 2020
Merged

Conversation

kaushikcfd
Copy link

  • Checks for line breaks with every Space keystroke.
  • Special treatment for lists, blockquotes, tables.

@kaushikcfd
Copy link
Author

@inducer: I have added a checkbox for hard wrapping as one of the preferences (off by default).

Copy link
Owner

@inducer inducer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just played with this. This is great! I'd be happy to deploy, I just would like the C-\ shortcut back. :)

@inducer inducer merged commit 0ed2d92 into inducer:add-hard-wrap Jun 21, 2020
@inducer
Copy link
Owner

inducer commented Jun 21, 2020

Deployed.

@kaushikcfd
Copy link
Author

Thanks 🎉

@inducer
Copy link
Owner

inducer commented Jun 25, 2020

Encountered something about this that isn't ideal: Some lines are just naturally long, e.g. links with long URLs. This change mercilessly butchers those, which left me confused and with no option but to turn it off in the middle of a meeting (and some document wreckage to clean up).

@kaushikcfd
Copy link
Author

Just an update: This needs a feature on hardwrap.js side. See this discussion. Working on it.

@inducer
Copy link
Owner

inducer commented Jul 3, 2020

If you continue working on this: Could you bring the C-\ shortcut back? (Despite its flaws, I've found myself wanting it back. One particular thing it offers is the ability to re-wrap a whole paragraph, which AFAIK isn't available now.)

@kaushikcfd
Copy link
Author

PR for fixing the wrapping long lines: codemirror/codemirror5#6338.

I agree wrapping a selection is a necessary feature. I also find myself hitting g-q in vim quite often. I'll try to revert the change (I would first like to see if a better implementation is simple-ish enough).

Also for the keybinding we could move to something like:

  1. Alt-Shift-w in the Sublime mode.
  2. g-q in the Vim mode
  3. Alt-q in the Emacs mode.

Wdyt?

@inducer
Copy link
Owner

inducer commented Jul 3, 2020

PR for fixing the wrapping long lines: codemirror/codemirror5#6338.

That's pretty cool. :)

Wdyt?

Totally agree with these. The only reason for C-\ is that I was lazy and picked something random.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants