Comments (3)
Hmm. This is in the category of "historical accident". There was a brief time when the Paragraph command tried to do what you indicated above, and it usually worked out alright. But there were lots of corner cases -- paragraphs that had nothing to do with programming or that contained comment-like characters that weren't comments at all -- which prompted us to revert back to a "dumber but consistent" behavior. Looks like the docs didn't make the transition.
I would like to have a comment-aware paragraphing option, but not at the expense of breaking normal text. Ne is supposed to be a Nice Editor, where unexpectedly mangling your text is decidedly Not Nice. I hope to revisit this issue some day.
from ne.
Thanks, Todd. Glad to hear it may be revisited in the future. Super useful feature, IMO, even if it were strictly limited to a subset of prefixes (like "> ", "// ", "# ") or to even just one prefix ("> ") to start with.
Maybe it would be possible for the user to set a default pref that says, "consider only the following strings as formatting prefixes when reflowing text with Paragraph: ...", if that simplifies and tightens things up.
Also, not sure if this is a corner case you were thinking about trying to solve, but I see that in code, lines of code usually directly follow comment lines (with no empty line between them). I could see how making Paragraph smart enough to handle that corner case would be complicated, and I would not expect Paragraph to try and figure that out. Paragraph works on paragraphs (delineated by blank lines). That is, I'd be happy to and expect to change:
// Comment line 1.
// Comment line 2.
function code(goes here) {...}
to
// Comment line 1.
// Comment line 2.
function code(goes here) {...}
before hitting [p
on that comment block to Paragraph it, and then go back and remove the extra newline.
from ne.
It occurs to me that I could also use the ne Through command, and have a small shell script do this. I'll give that a try.
from ne.
Related Issues (20)
- Feature Request: Bracketed Paste Mode HOT 13
- [Question] Contribution Guidelines
- [Bug Report] Configured Coding Languages are not Highlighted HOT 2
- [Feature Request] copy current line HOT 3
- Avoid FTBFS when using binutils-gold HOT 1
- build fails in archlinux HOT 8
- Feature request: Search upwards HOT 5
- Matching braces HOT 1
- Bug when using Through with request_string HOT 3
- Cannot compile on CentOS 7.9 HOT 5
- Compilation errors on NetBSD (9.2 Stable) HOT 3
- Error: File doesn't exist HOT 4
- Autocomplete with empty prefix causes ne to hang (macos) HOT 6
- make -j fails HOT 3
- Table of contents at the end? HOT 5
- [Feature Request] a way to move cursor to end of paste HOT 6
- "0x" prefix "tolerated" in ~/.ne/.keys file HOT 5
- autocomplete (or tab complete) macro names?
- truncation warning HOT 1
- Empty initializer list HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ne.