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

Extension uses a specific word wrap setting on AsciiDoc files #800

Open
jeffrey-chongsathien-oxinst opened this issue Oct 11, 2023 · 9 comments
Labels
💬 discussion Disccussion on new features, projects, etc... 📖 documentation ❔ question

Comments

@jeffrey-chongsathien-oxinst
Copy link

jeffrey-chongsathien-oxinst commented Oct 11, 2023

When editing an .adoc file, the settings mentioned in the title are ignored by the editor. Is this intended behaviour? If so, why is it desirable?

Ascidoc > Preview: Use Editor Style is set to Yes.

@ggrossetie
Copy link
Member

It seems to be working as intended:

wordwrap

toggle-word-wrap

Could you please provide details about:

  • What you're trying to do
  • What happened
  • What you expected to happen

@amckibben
Copy link

I absolutely could not my global user settings for word wrap to apply to asciidoc files 🤷 Worked flawlessly for any other type of file I typically edit (json, yaml, go, python, markdown, etc.).

I figured there must be something overriding / blocking those settings at the workspace level, but could not find any evidence of that.

Finally I just added word wrap settings specifically for the asciidoc language to my global user settings with a block like the following, and that worked like a charm:

  "[asciidoc]": {
    "editor.wordWrap": "bounded",
    "editor.wordWrapColumn": 100
  }

@ggrossetie
Copy link
Member

@amckibben I guess global user settings have a lower precedence than:

"configurationDefaults": {
"[asciidoc]": {
"editor.wordWrap": "on",
"editor.quickSuggestions": false
}
},

The Markdown extension is using more or less the same settings: https://github.com/microsoft/vscode/blob/f88bce8fe6a6d2ccd27cbd64bb26853cd8779afa/extensions/markdown-language-features/package.json#L692-L701

So I'm not really sure why it does not work the same... 🤔

@ggrossetie ggrossetie added ❔ question 💬 discussion Disccussion on new features, projects, etc... and removed 🐞 bug labels Mar 9, 2024
@ggrossetie
Copy link
Member

I guess this is more a debate about if we should define a specific wordWrap and, if so, which default value we should use.
Any opinion on this matter @mojavelinux @ahus1? I guess wordWrap: on is a good default value when reading/writing documentation no?

@ggrossetie ggrossetie changed the title Editor ignores VS Code's "Editor: Word Wrap" and "Editor: Word Wrap Column" settings Extension uses a specific word wrap setting on AsciiDoc files Mar 9, 2024
@ggrossetie
Copy link
Member

And also a documentation issue to explain how to override it using:

  "[asciidoc]": {
    "editor.wordWrap": "bounded",
    "editor.wordWrapColumn": 100
  }

(as mentioned by Alex)

@mojavelinux
Copy link
Member

I'm not entirely sure what the question is. I would expect that the text would soft wrap when it overflows the visible area. Is that the feature being discussed?

@ggrossetie
Copy link
Member

Yes that's correct:

  // Controls how lines should wrap.
  //  - off: Lines will never wrap.
  //  - on: Lines will wrap at the viewport width.
  //  - wordWrapColumn: Lines will wrap at `editor.wordWrapColumn`.
  //  - bounded: Lines will wrap at the minimum of viewport and `editor.wordWrapColumn`.
  "editor.wordWrap": "off",

You can control word wrap through the editor.wordWrap setting. By default, editor.wordWrap is off but if you set to it to on, text will wrap on the editor's viewport width.

https://code.visualstudio.com/docs/editor/codebasics#_how-do-i-turn-on-word-wrap

We are using "editor.wordWrap": "on" on AsciiDoc files. So, the text will soft wrap at the viewport width.

@mojavelinux
Copy link
Member

We are using "editor.wordWrap": "on" on AsciiDoc files. So, the text will soft wrap at the viewport width.

That seems like a reasonable default to me.

@ahus1
Copy link
Contributor

ahus1 commented Mar 24, 2024

Same here, it is a reasonable default.

The AsciiDoc plugin for IntelliJ choses a different way: In IntelliJ, there is a global setting for enabling this by file extension. When using the AsciiDoc plugin for IntelliJ for the first time, it show a notification and tries to guide the user to this setting to change it there, as I didn't want to have a plugin-specific setting when there is a global one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
💬 discussion Disccussion on new features, projects, etc... 📖 documentation ❔ question
Projects
None yet
Development

No branches or pull requests

5 participants