GithubHelp home page GithubHelp logo

Option to use absolute column width about rewrap HOT 7 CLOSED

stkb avatar stkb commented on July 22, 2024
Option to use absolute column width

from rewrap.

Comments (7)

stkb avatar stkb commented on July 22, 2024

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.

calmh avatar calmh commented on July 22, 2024

Tabs. Perhaps the issue, they are seen as one character each?

from rewrap.

stkb avatar stkb commented on July 22, 2024

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.

calmh avatar calmh commented on July 22, 2024

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.

stkb avatar stkb commented on July 22, 2024

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.

calmh avatar calmh commented on July 22, 2024

Looks good 👍

from rewrap.

stkb avatar stkb commented on July 22, 2024

Great. Thanks for reporting!

from rewrap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.