Comments (7)
Hmm, how you describe (absolute column) is exactly how it should be working, and if it's not, it's a bug.
Are you indenting with tabs or spaces?
from rewrap.
Tabs. Perhaps the issue, they are seen as one character each?
from rewrap.
Yeah :) Trying your example with 4-space indents I got the correct result
// wrapped at column
// twenty-two.
// wrapped at
// column
// twenty-two.
But when using tabs it came out like this, as you described.
// wrapped at column
// twenty-two.
// wrapped at column
// twenty-two.
The issue is indeed that it's counting tabs as one character each for the purpose of working out where to wrap. VSCode doesn't (yet) make the tab display width available to extensions. But hopefully I can detect it in some way.
Genuine general question though, because I've always used spaces: How does fixing everything to a specific column width make sense when using tabs? Because if you for example, render tabs at 2 spaces and then make all your code wrap at column 80, and then someone else reads the code but renders the tabs at 4 spaces each, the line wrapping's all gonna be off. Or does it just not matter?
from rewrap.
You're right, in that case the wrapping will be off for one of us. I'd say that doesn't matter as it's an inherent property of using tabs for indentation, but that it would be nice if this plugin did the right thing based on the settings it can figure out when it's invoked. :)
In the meantime, this isn't exactly a blocker and I'm happy to have some wrapping functionality in vscode, so feel free to put this on the backburner until the tab width config is available to the plugin somehow.
from rewrap.
I've just pushed out a new version that should fix this issue (v0.4.1). Could you let me know if it's now working for you?
from rewrap.
Looks good
from rewrap.
Great. Thanks for reporting!
from rewrap.
Related Issues (20)
- [Feature Request] Support `.razor` files
- Feature request: support javadoc in Ruby comments
- OSX: '.' inserted when adding two spaces after a word HOT 1
- HTML comments in Markdown with no content left of the comment
- Invoking Rewrap from outside of VS Code: to run as a linter? HOT 1
- Running tests & ./do
- Installing from source (to VS Code)
- CONTRIBUTING.md
- Feature request: Clicking on the auto-wrap icon should toggle auto-wrap mode
- Does not rewrap a comment?
- can't get the extension to do anything on a rust file... HOT 3
- Soft rewrap
- Valid comments with unusual comment markers are not wrapped correctly.
- Feature request HOT 1
- Hyphen- and indentation-aware wrapping in YAML
- Request: set line length to 100 for rust doc comments HOT 1
- Bullets / lists are not respected in comments that use `///` HOT 2
- This extension blocked typing "@" on Latin American keyboard layout
- PHPDoc tags sometimes break
- Alt + Q Default Shortcut Not Working
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 rewrap.