Text Block Rewrap Module #298
eric1234
started this conversation in
Show and tell
Replies: 1 comment 1 reply
-
This is nice, but since you're on both Linux and macOS, why not make use the Unix fmt command? My format module uses it: https://github.com/orbitalquark/textadept-format/
|
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Something I missed from previous editors was a hotkey to rewrap text. Most of the time I want to limit the line width to 80 characters because long lines are hard to read (and it's even more annoying at the terminal). This means I'm usually inserting a line break every 80ish characters when writing a block of text.
The problem is if you go back and edit that block of text where the first line is already near 80 and add more content you end up moving some of the text to the next line which makes it too long so you have to move some of it to the 3rd line, etc usually until you end up at the end of the text block. That's a lot of editing.
A rewrap hot key allows you to select the paragraph after you get done adding your content, press
Ctrl-Q
and it will automatically figure out where to add the line breaks. Even more important is the same thing in code comments. Only here each line has some sort of prefix to indicate the line is a comment and indention. Once re-wrapped we want to to preserve that indention and still prefix each line with the comment indicator.The below module is my first crack at implementing this. Still fairly new so I'm sure there are bugs but figured I would go ahead and share in case anybody else wants to use:
Beta Was this translation helpful? Give feedback.
All reactions