DevToys-app / DevToys

A Swiss Army knife for developers.
https://devtoys.app/
MIT License
26.94k stars 1.45k forks source link

DevToys 2.0 Preview: JSON Formatter does not change indent guides to match the indentation. #1252

Closed TrangOul closed 3 months ago

TrangOul commented 3 months ago

Current behavior

JSON Formatter remember the indentation used on previous app usages, and it can be changed. The indentation guides (those semi-transparent vertical lines in indented lines), however, stay to match the previous session's indentation and cannot be changed.

How to reproduce it (as minimally and precisely as possible)

  1. Launch DevToys.
  2. Go to JSON Formatter and paste a (nested) JSON.
  3. Set the indentation to x spaces.
  4. Relaunch DevToys.
  5. Go to JSON Formatter and paste a (nested) JSON.
  6. Change the indentation from x spaces to y spaces.
  7. Indentation lines are not changed.

If 1 tab or "minified" is used initially instead of x spaces, it has the same effect as 4 tabs, also broken if changed to 2 tabs.

Expected behavior

Indentation guide lines change with the indentation.

Screenshots

4 spaces initially, changed to 2 spaces. image

2 spaces initially, changed to 4 spaces. image

Workaround

Select the desired indentation and restart DevToys.

Affected platforms

Windows

Affected DevToys kind

DevToys (app with GUI)

DevToys Version

Version 2.0-preview.2

Relevant Assets/Logs

No response

veler commented 3 months ago

Duplicate with #837