visual: Crash when replace characters
### Version

_No response_

### Environment

_No response_

### Category

Major — The software does not fulfill the task it is designed for.

### Steps to Reproduce

1. `$ moe src/moe.nim`
2. `v`
3. `$`
4. `ra`

### Detailed Description

_No response_