Skip to content
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: autowrap per filetype #149

Closed
wevre opened this issue Jun 7, 2019 · 8 comments
Closed

Feature Request: autowrap per filetype #149

wevre opened this issue Jun 7, 2019 · 8 comments

Comments

@wevre
Copy link

wevre commented Jun 7, 2019

Allow the rewrap.autowrap.enabled setting to be specified on a per filetype basis.

I'd love to be able to turn it off, for example, for some filetypes, but otherwise leave it on globally.

"rewrap.autoWrap.enabled": true,
"[xml]": {
    "rewrap.autoWrap.enabled": false,
}
@memeplex
Copy link

I wanted to asked this too but I settled down on a more modest proposal: #142

The fact that a soft-wrapping document could be silently being hard-wrapped should be fixed. The wrap column is common to both kind of wrapping so it's difficult to spot this is happening.

@aleclarson
Copy link

It's kinda weird that this doesn't work OOTB. Is there some special VSCode API for detecting filetype-specific settings?

@kbd
Copy link

kbd commented Nov 10, 2019

Just attempted to:

    "[plaintext]": {
        ...
        "rewrap.autoWrap.enabled": true,
    },

and it didn't work. I didn't even realize you couldn't specify settings like that per file-type. It would be wonderful if Rewrap could do this and save me a manual toggle each time. Thanks!

@stkb
Copy link
Owner

stkb commented Aug 20, 2020

The next release will have the change many of you have been waiting for: rewrap.autoWrap.enabled can now be set per language.

Additionally, the rewrap.toggleAutoWrap command is still present, and can be used if you want to temporarily turn it on/off, but this is now a separate "per-document override" instead.

To help you keep track of when autowrap is on or off, there's a now a small (optional, but on by default) icon/notification in the right of the statusbar. This is controlled by the rewrap.autoWrap.notification setting, which currently has two options: 'icon' | 'text'.

'icon' (default)

This shows a small icon in the bottom right for the autowrap status of the current document. It actually has 4 states:

  • (normal): on, enabled in settings
  • (hidden): off, disabled in settings
  • (orange): temporarily enabled, from toggle command
  • (gray): temporarily disabled, from toggle command

The icon's tooltip also gives some more information (will help with confusion like in #214)

Naturally not everyone wants an extra icon in their statusbar, so they can either hide it, or use the text option instead.

'text'

There's also a 'text' notification option. This works almost the same as in the current version: it shows "Auto-wrap: on/off" for a few seconds when it's toggled on/off. But it now shows only when toggled. So if you never use that toggle command, you'll never see anything. (Fixes #144)

The beta version is available to download. Feedback is welcome!

I also haven't forgotten about a "full" auto-wrap setting (#65); it's still on my todo list.

@wevre
Copy link
Author

wevre commented Aug 20, 2020 via email

@max-sixty
Copy link

Could I ask whether the release referenced above was released? I don't see those options available.

Thank you for the excellent extension!

@stkb
Copy link
Owner

stkb commented Feb 11, 2021

@max-sixty no it never got released. Coincidentally I've just started working on it again this week and it will be released in the next day or two. If you can't wait then you can still download & install the beta version above

@stkb
Copy link
Owner

stkb commented Feb 15, 2021

v1.14.0 is now released! so closing

@stkb stkb closed this as completed Feb 15, 2021
@stkb stkb unpinned this issue Feb 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants