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

Breaks Tab key, ignoring VSCode settings and inserting spaces instead #1146

Open
brandonkal opened this issue Jul 2, 2022 · 7 comments
Open
Labels
Area: Input Related to editor input processing (key presses, key bindings). Issue: Question Res: Answered Discussion closed with no more specific state.

Comments

@brandonkal
Copy link

Problem

When this extension is enabled, the tab key inserts two spaces instead of how the VSCode editor is configured.

How to reproduce

  1. Configure VSCode to use tabs for indentation and set tab size to 4. Make whitespace visible to see the issue.
  2. Open a markdown file with tab-indented nested bullet lists
  3. Hit the tab key in front of a line of text to increase the indent of that line (or use the VSCode shortcut cmd+])
  4. Observe that two spaces are used in place of the tab character

Disabling this extension eliminates the issue so this extension is likely doing something funky.

Configuration

Default

Environment

Name: Markdown All in One
Id: yzhang.markdown-all-in-one
Description: All you need to write Markdown (keyboard shortcuts, table of contents, auto preview and more)
Version: 3.4.3
Publisher: Yu Zhang
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one

VSCode About
Version: 1.68.1
Commit: 30d9c6cd9483b2cc586687151bcbcd635f373630
Date: 2022-06-14T12:52:13.188Z
Electron: 17.4.7
Chromium: 98.0.4758.141
Node.js: 16.13.0
V8: 9.8.177.13-electron.0
OS: Darwin x64 19.6.0

@yzhang-gh
Copy link
Owner

Did you check the tab size at the right bottom corner? In Markdown files it is often automatically set to 2. The tab key should work as expected if you have the tab size configured as 4.

@yzhang-gh yzhang-gh added Needs More Info Area: Input Related to editor input processing (key presses, key bindings). labels Jul 2, 2022
@knutov
Copy link

knutov commented Jul 10, 2022

It's really broken.

изображение

Step to reproduce:

  1. create new file
  2. set tab size to 4, select use tabs, select markdown as format
  3. type something
  4. select some string, use tab or ctrl+]

It will be indented with 3 spaces :(

@yzhang-gh
Copy link
Owner

The Tab may not work 100% as I expect (e.g. for multiline selection). However, the tab configuration is respected on my machine.

1146

@knutov
Copy link

knutov commented Jul 10, 2022

Did test again, and it's always 3 spcaces with this extension installed. Even if I set use tabs and tab size = 8.

From extension list with query "@installed markdown" only this extension installed.

With this extension disabled tab size works as expected.

Version: 1.69.0 (user setup)
Commit: 92d25e35d9bf1a6b16f7d0758f25d48ace11e5b9
Date: 2022-07-07T05:28:36.503Z (3 days ago)
Electron: 18.3.5
Chromium: 100.0.4896.160
Node.js: 16.13.2
V8: 10.0.139.17-electron.0
OS: Windows_NT x64 10.0.19044

Could some other extension conflict with this?

@knutov
Copy link

knutov commented Jul 10, 2022

more tests: Extensions - Disable all installed - reload.

only remote ssh from microsoft enabled and this one, and the problem exists.

@knutov
Copy link

knutov commented Jul 10, 2022

More details: If I select only one line the problem occures. But if I select 2+ lines - all works with tabs as expected. And usually problem happens only with lists, not with paragraphs.

Also, for unnumbered lists it is two spaces, while for numbered - three spaces.

Recording 2022-07-11 at 00 00 24

@yzhang-gh
Copy link
Owner

Alright, I get the point from your last GIF. By default, the "indentation" inside a Markdown list is changed to "adaptive" mode. That's why you get 3 spaces right after an ordered list and 2 for an unordered list.

Please change markdown.extension.list.indentationSize to inherit and you will always get the configured tab size. (cc @brandonkal)

@yzhang-gh yzhang-gh added Issue: Question Res: Answered Discussion closed with no more specific state. and removed Needs More Info labels Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: Input Related to editor input processing (key presses, key bindings). Issue: Question Res: Answered Discussion closed with no more specific state.
Projects
None yet
Development

No branches or pull requests

3 participants