hackmdio / hackmdio/hackmd-io-issues

block visual mode: literal tabs treated oddly

Open
#372 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
40
Forks
9
PR merge metrics
No merged PRs in 30d

Description

### 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

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.