hackmdio / hackmdio/hackmd-io-issues

block visual mode: literal tabs treated oddly

Offen
#372 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Keine Sprachdaten
Sterne
40
Forks
9
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

### Is this a hackmd.io issue?

- [X] Yes, the bug happens on https://hackmd.io
- [ ] No. If it's a self-hosted CodiMD instance, please fire up the issue in the repo of CodiMD: https://github.com/hackmdio/codimd

### Read our Official tutorial

It's on https://hackmd.io/c/tutorials/

或是中文版 https://hackmd.io/c/tutorials-tw/

### What's the problem
When in `vim` mode, Visual Block mode (`ctrl+v`) incorrectly manipulates tab characters as if they are of width one, rather than the width visually exposed.

#### Current behaviour

> Screenshot (optional)
![image](https://github.com/hackmdio/hackmd-io-issues/assets/1756464/2119a109-de3f-4f74-9f91-015500c93d64)

Provide steps to reproduce:

1. Create a document, such as a table, consisting of both tabs and spaces
```markdown
|
\t|
```
2. set to use Vim mode and enter command mode (`esc`)
3. `gg` to go to the top
4. `ctrl+v` to enter visual block mode
5. `G` to go to the bottom row
6. `A` to append. Notice that rather than a clean block selection, a jagged edge is selected.

[example note](https://hackmd.io/wfKBo0kRRUSkZZqIwF-N4w)

#### Expected behaviour

Tabs should be treated with their rendered width, not width one.

#### Environment

I use HackMD on:

**Desktop**
- OS: macOS and Windows
- Browser: Firefox
- Browser Version: 125

**Mobile**
n/a

#### Additional context

n/a

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Das Issue nennt keine Dateien oder Tests. Beginne damit, die Vim-mode-Visual-Block-Auswahl mit dem bereitgestellten Beispiel aus gemischten Tabs und Leerzeichen zu reproduzieren, verfolge dann den Einstiegspunkt der Auswahl und überprüfe, dass Tabs ihre gerenderte Breite statt der Breite eins verwenden. Fertig ist es, wenn die Blockkante sauber ist und den erwarteten visuellen Spalten entspricht.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
vim
Bereich
frontend
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Klar beschrieben
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.