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

Incorrectly indented tabs if word length < editor.tabSize #201086

Closed
KONEY opened this issue Dec 17, 2023 · 2 comments
Closed

Incorrectly indented tabs if word length < editor.tabSize #201086

KONEY opened this issue Dec 17, 2023 · 2 comments
Assignees

Comments

@KONEY
Copy link

KONEY commented Dec 17, 2023

I've asked for help on stackoverflow where I was suggested this can actually be a bug to report so here it is.

I'm switching to VSCode but at this point all my sources are quite messed up and I manage to pinpoint what the problem is.

Basically when a tabulation char follows a word which is shorter than the editor.tabSize value VS will insert the amount of spaces in its settings minus the word length when it should probably insert said value PLUS the editor value.

An example code rendered in Notepad:
aWL8j

Same code rendered by VSCode with editor.tabSize=4:
5XKQ3

Every instruction is followed by ONE tab but VSCode requires TWO if tab follows a word shorter than tabSize.

Here tabs following "LEA" instructions end up being only one space long (tabSize minus length of word)

Is there a way to prevent this annoying behaviour? Changing all the occurencies in code would be quite a long work and they would be messed up when opened in other editors, surely not a solution.

Thanks!

VS Code version: Code 1.85.1 (0ee08df, 2023-12-13T09:49:37.021Z)
OS version: Windows_NT x64 10.0.19045
Modes: Unsupported

System Info
Item Value
CPUs Intel(R) Core(TM) i5-10600K CPU @ 4.10GHz (12 x 4104)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.64GB (9.08GB free)
Process Argv --crash-reporter-id 509de80c-a079-41c3-9e37-3cb0e6345156
Screen Reader no
VM 0%
Extensions (3)
Extension Author (truncated) Version
vs-code-custom-ui-font ani 1.0.2
vscode-custom-css be5 7.2.1
amiga-assembly prb 1.8.6
A/B Experiments
vsliv368cf:30146710
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vstes627:30244334
vslsvsres303:30308271
vserr242:30382549
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263:30899288
vsclangdf:30486550
c4g48928:30535728
dsvsc012:30540252
azure-dev_surveyone:30548225
3biah626:30602489
89544117:30613380
2i9eh265:30646982
showlangstatbar:30737416
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
welcomedialogc:30910334
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
dsvsc013:30795093
dsvsc014:30804076
dsvsc015:30845448
pythontestfixt:30902429
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
h48ei257:30885898
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
aa_t_chat:30882232
dsvsc019cf:30917260
cp7184c:30925681

@RedCMD
Copy link
Contributor

RedCMD commented Dec 17, 2023

you can change the size of the tabs in the bottom right corner
looks like Notepad used 8wide tabs
while VSCode defaults to 4wide

there's more options in settings

tabs are 'bound' to a grid
placing a tab within any of the 4spaces of a 'cell' will padd it out to the end of that 'cell'
the problem is you have instructions that are below and above a multiple of 4 chars long, meaning they end in different cells

@KONEY
Copy link
Author

KONEY commented Dec 17, 2023

Setting tab size to 10 fixed the problem!

thanks!

@KONEY KONEY closed this as completed Dec 17, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Jan 31, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants