Crash when replacing characters in visual mode
### Version

moe v0.3.0

Git hash: a3d0f9fa815abfb14315b7814bc3ade903385b2c
Build type: Debug

### Environment

_No response_

### Category

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

### Steps to Reproduce

1. `v` - Enter visual mode
2. `r` - Replace command
3. Crash

### Detailed Description

/home/fox/git/moe/src/moe.nim(104) moe
/home/fox/git/moe/src/moe.nim(100) main
/home/fox/git/moe/src/moepkg/mainloop.nim(503) editorMainLoop
/home/fox/git/moe/src/moepkg/mainloop.nim(248) execEditorCommand
/home/fox/git/moe/src/moepkg/mainloop.nim(79) execCommand
/home/fox/git/moe/src/moepkg/visualmode.nim(721) execVisualModeCommand
/home/fox/git/moe/src/moepkg/visualmode.nim(564) visualCommand
/home/fox/git/moe/src/moepkg/visualmode.nim(287) replaceCharacter
/home/fox/.choosenim/toolchains/nim-2.0.0/lib/system/fatal.nim(53) sysFatal
Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]