Skip to content

Missing tab width adjustment #555

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

Closed
timchpi opened this issue Oct 16, 2021 · 9 comments
Closed

Missing tab width adjustment #555

timchpi opened this issue Oct 16, 2021 · 9 comments
Assignees
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: enhancement Proposed improvement

Comments

@timchpi
Copy link

timchpi commented Oct 16, 2021

Is your feature request related to a problem? Please describe.
The tab width cannot be adjusted like in previous versions.

Describe the solution you'd like
Bring back the option to adjust tab width.

Please, and thank you :)

@timchpi timchpi added the type: enhancement Proposed improvement label Oct 16, 2021
@per1234
Copy link
Contributor

per1234 commented Oct 20, 2021

Hi @kxcheng. Thanks so much for your report. Unfortunately, I didn't manage to understand what you mean be adjusting the tab width. There is some ambiguity because the term "tab" is used to several completely different things in the context of the Arduino IDE:

  • The whitespace produced by pressing the Tab key on the keyboard while using the IDE's editor.
  • The GUI element used to switch between sketch files.
  • The editor for each sketch file.

Please provide detailed instructions for the procedure you used to adjust the tab width in the previous versions.

Please tell us the exact previous version you were able to adjust the tab width in.

@per1234 per1234 added the status: waiting for information More information must be provided before work can proceed label Oct 20, 2021
@timchpi
Copy link
Author

timchpi commented Oct 21, 2021

Dear @per1234:
I apologise for the lack of clarity.
What I meant by tab width is the number of white spaces inserted when 'tab' key is pressed.

In version 1.8.15(and as far as I am aware of various other versions) the user can adjust this by opening C:\Users<username>\AppData\Local\Arduino15\preferences.txt, editing line 38 which default to "editor.tabs.size=2".

I would really really appreciate it if this feature is to be brought back.
Cheers,
Tim

@per1234
Copy link
Contributor

per1234 commented Oct 21, 2021

Thank you for the clarification!

It is already possible to configure this via Arduino IDE's advanced settings:

  1. Press the Ctrl+Shift+P keyboard shortcut (Command+Shift+P for macOS users) to open the "Command Palette".
  2. Select the "Preferences: Open Settings (UI)" command from the menu.
    You can scroll down through the list of commands to find it or type the name in the field.
    A "Preferences" tab will open in the Arduino IDE main panel.
  3. Type editor.tabSize in the "Search Settings" field of the "Preferences" tab.
  4. Set your preferred tab side in the field under the "Editor: Tab Size" setting.
  5. Close the Preferences tab by clicking its X icon.

Even though you only mentioned the whitespace resulting from pressing Tab, most who want to customize that will also want to customize the IDE's auto format configuration to match. You can learn how to customize the formatter configuration from this tutorial:

https://docs.arduino.cc/software/ide-v2/tutorials/ide-v2-customize-auto-formatter

You will be interested in the IndentWidth setting.


If you like the approach required of Arduino IDE 1.x users of configuring advanced settings by editing a configuration file directly, you can open C:\Users<username>\AppData\.arduinoIDE\settings.json (~/.arduinoIDE/settings.json for any Linux users who are reading this) and then change the value of the editor.tabSize key.


Regards, Per

@per1234 per1234 closed this as completed Oct 21, 2021
@per1234 per1234 added conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself and removed status: waiting for information More information must be provided before work can proceed labels Oct 21, 2021
@timchpi
Copy link
Author

timchpi commented Oct 24, 2021

I am sorry but neither of these seems to work for me?
image
image

Please advise,
Tim

@per1234
Copy link
Contributor

per1234 commented Oct 24, 2021

The second screenshot shows you are opening the basic preferences via File > Preferences menu. The tab width is set in the advanced preferences. As I mentioned above, those are accessed by opening the Command Palette (Ctrl+Shift+P) and then selecting Settings: Open Preferences.

@timchpi
Copy link
Author

timchpi commented Oct 28, 2021

My apologies. However, I am still unable to locate the setting in advanced setting page.
image

Also I am also unable to locate the file you mentioned.

Cheers,
Tim

@per1234
Copy link
Contributor

per1234 commented Oct 28, 2021

It is called "Editor: Tab Size" in the advanced preferences GUI:

image

I am also unable to locate the file you mentioned.

You can open it in the Arduino IDE by clicking the {} icon:
image

But for those who aren't already familiar with the settings.json system from using VS Code, it will be much easier to just use the advanced preferences GUI to configure the IDE.

@timchpi
Copy link
Author

timchpi commented Oct 29, 2021

I see. Thank you very much!

Tim

@per1234 per1234 self-assigned this Nov 12, 2021
@ProxyPlayerHD
Copy link

ProxyPlayerHD commented Aug 19, 2022

I'm confused, how are you supposed to know of the existance of the "Command Palette" as a newer user (i didn't know that was a thing until i found this page...)
and why have 2 seperate preferences menus with the less useful one being much simpler to access? why not just combine them into one and have it easily accessible from toolbar under File -> Preferences?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
conclusion: invalid Issue/PR not valid topic: code Related to content of the project itself type: enhancement Proposed improvement
Projects
None yet
Development

No branches or pull requests

3 participants