pgadmin4 icon indicating copy to clipboard operation
pgadmin4 copied to clipboard

Query tool: Pressing [tab] does not align to next tab position

Open brsa opened this issue 1 year ago • 2 comments
trafficstars

Pressing the [tab] key does not align at the next tab position, which is the actual purpose of the [tab] key.

To reproduce, activate "Use spaces?" with "Tab size" = 3 (for example). Then, in the query tool:

  • Press [tab] → 3 spaces are entered
  • On the next line, enter 1 character, then press [tab] → still 3 spaces are entered, but it should be 2 spaces to align at position 3
  • On the next line, enter 2 characters, then press [tab] → still 3 spaces are entered, but it should be 1 space to align at position 3
-- expected:
   |
1  |
12 |
123   |
1234  |

-- status quo:
   |
1   |
12   |
123   |
1234   |

I am running Ubuntu Ubuntu 20.04.6 LTS. This is what "About pgAdmin4" dumps:

Version 8.6 Application Mode Desktop Current User [email protected] NW.js Version 0.77.0 Browser Chromium 114.0.5735.91 Operating System Linux-5.15.0-105-generic-x86_64-with-glibc2.29 pgAdmin Database File /home/erwin/.pgadmin/pgadmin4.db Log File /home/erwin/.pgadmin/pgadmin4.log

Originally posted by @brsa in https://github.com/pgadmin-org/pgadmin4/issues/7269#issuecomment-2095195290

brsa avatar May 17 '24 21:05 brsa

In discussion with upstream - https://discuss.codemirror.net/t/pressing-tab-does-not-align-to-next-tab-position/8349

adityatoshniwal avatar Jun 18 '24 06:06 adityatoshniwal

In discussion with upstream - https://discuss.codemirror.net/t/pressing-tab-does-not-align-to-next-tab-position/8349

@akshay-joshi or @adityatoshniwal As it is already somewhat time ago, I was wondering what the outcome of the discussion is. From functional perspective it seems clear. The technical issue, as posted in the discussion, is a thing I do not understand. :man_shrugging:

casparsch avatar Aug 07 '24 11:08 casparsch

Tested and verified on snapshot build: https://www.postgresql.org/ftp/pgadmin/pgadmin4/snapshots/2024-11-28/ Package: arm64 Environment: macOs Sonoma 14.7.1

anilsahoo20 avatar Nov 28 '24 04:11 anilsahoo20

Did some first editing (using tab-key) and I'm happy with the solution made. It save me so much time re-aligning the code. Thank you :relieved:

casparsch avatar Dec 12 '24 13:12 casparsch