-
-
Notifications
You must be signed in to change notification settings - Fork 59
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
feature request: auto-fill-mode #45
Comments
Hi and thanks for the feedback and request! I've seen this mentioned elsewhere so have thought about it a little; have just been waiting for someone to request it. It's got some tricky aspects and might not be battery friendly. But I will look into it after the next release. |
Wonderful; thanks! And I can totally see how there would be nuance to implementing this. |
I would also love to have this feature. We should be able to turn it on or off. It should be off by default. |
Would love to see this for markdown, comments, and other documentation/non-code blocks! |
I now have a beta version with this feature, to try out. The feature works similarly to that in emacs, in that it only triggers after pressing space or enter if the cursor is past the wrapping column, and it only wraps that current line (which is fine for most normal typing). If you insert text into a line of make other complex changes, you'll need to do a manual Enable it with the The command doesn't have a default keybinding, but you can add your own in the normal way by binding to the command Naturally it only applies in comments or markdown/text documents, so you may be fine with leaving it on all the time. You'll need to enable it each time you start vscode though, but I might change that so the on/off setting persists between sessions. InstallationDownload this .zip file and rename it to a .vsix file: rewrap-1.6.0-beta2.zip From the extensions sidebar in vscode:
I've also changed some of the general parsing code since the last version, so you may experience other bugs. |
I just tried the beta and quickly hit an error which I filed as a new issue. LMK if you prefer that I add future problems with the beta in this thread or as separate issues. |
@gwf Thanks I've found the cause and will have a fix out soon. The problem seems to be restricted to LaTeX files. It doesn't really matter but we can probably keep all issues with the beta here. |
Ok, here's beta 2 (have updated the comment above too) As before, rename to .vsix and remove any existing version first. Thanks for testing :) |
Looking good. All of the problems from before are resolve. Well done! May I also suggest that you trigger auto-wrap on a space keystroke within the interior of a paragraph as well? Obviously, you only need to trigger it when the right edge is to the right of the limit. With this change, I think it will more closely approximate Emacs auto-fill-mode. |
Thanks, glad the bugs are fixed. Do you have a plugin that does that that? Because afaik Emacs doesn't wrap when pressing space in the middle of a line (https://www.gnu.org/software/emacs/manual/html_node/emacs/Auto-Fill.html)
That's how it's working for me in both vanilla Emacs and with the AUCTeX plugin; it only wraps once the cursor is past the wrapping column again. The other way can be done, it just means having to re-adjust the whole contents of the paragraph each time, otherwise you have very undesirable results. I could add the option for either I guess. |
@stkb, you're correct and my memory of how auto-fill-mode works in Emacs was wrong. Sorry about that. |
Vim also supports this with |
v1.6.0 is finally published. If you're using a beta version please uninstall (& restart) before re-installing from the marketplace. |
First off, thanks for writing Rewrap; this is really great and already makes editing code a bunch easier!
An even higher level of awesome would be to support the equivalent of emacs auto-fill mode, where it fixes up wrapper automagically while you type.
The text was updated successfully, but these errors were encountered: