Langmap always remaps in normal mode
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
Describe the bug
I have a langmap from Cyrillic to English like that:
"vim.langmap": "ФИСВУАПРШОЛДЬТЩЗЙКЫЕГМЦЧНЯ;ABCDEFGHIJKLMNOPQRSTUVWXYZ,фисвуапршолдьтщзйкыегмцчня;abcdefghijklmnopqrstuvwxyz"
If I want to replace a symbol using vim's r command, the replacement symbol always appears to be Cyrillic, regardless of what my current language is. Same goes for searching for characters with f command.
To Reproduce
Steps to reproduce the behavior:
- Enable langmap.
- Type some text like
123. - With English layout press
rtwice with cursor on the first symbol. The result would beк23instead ofr23.
Expected behavior
Replacement or searching for letters works with respect to current layout.
Screenshots
Log from typing 123 and then trying rr on the first character:
2025-01-11 15:22:38.543 [info] Configuration changed
2025-01-11 15:22:44.789 [debug] 0 errors found with vim configuration
2025-01-11 15:22:44.790 [debug] Start
2025-01-11 15:22:44.790 [debug] Status bar: -- NORMAL --
2025-01-11 15:22:44.821 [debug] Handling key: <extensionenable>
2025-01-11 15:22:44.826 [debug] Finish.
2025-01-11 15:22:45.236 [info] Configuration changed
2025-01-11 15:22:45.237 [debug] 0 errors found with vim configuration
2025-01-11 15:22:45.431 [info] Configuration changed
2025-01-11 15:22:45.432 [debug] 0 errors found with vim configuration
2025-01-11 15:22:47.512 [info] Active editor: output:tasks
2025-01-11 15:22:49.581 [info] tasks closed
2025-01-11 15:22:49.581 [info] Active editor: untitled:Untitled-1
2025-01-11 15:22:51.195 [debug] Handling key: i
2025-01-11 15:22:51.199 [debug] Status bar: -- INSERT --
2025-01-11 15:22:52.947 [debug] Handling key: 1
2025-01-11 15:22:52.948 [debug] Adding Transformation {"type":"insertTextVSCode","text":"1","isMultiCursor":false}
2025-01-11 15:22:52.953 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:22:52.958 [debug] Set nextStepStartPosition to [0, 0]
2025-01-11 15:22:54.063 [debug] Handling key: 2
2025-01-11 15:22:54.064 [debug] Adding Transformation {"type":"insertTextVSCode","text":"2","isMultiCursor":false}
2025-01-11 15:22:54.068 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:22:54.383 [debug] Handling key: 3
2025-01-11 15:22:54.384 [debug] Adding Transformation {"type":"insertTextVSCode","text":"3","isMultiCursor":false}
2025-01-11 15:22:54.386 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:22:56.833 [debug] Handling key: <Esc>
2025-01-11 15:22:56.836 [debug] Finished history step with 1 change(s)
2025-01-11 15:22:56.837 [debug] Status bar: -- NORMAL --
2025-01-11 15:22:59.783 [debug] Handling key: 0
2025-01-11 15:23:01.577 [debug] Handling key: r
2025-01-11 15:23:01.888 [debug] Handling key: r
2025-01-11 15:23:01.888 [debug] Adding Transformation {"type":"replaceText","text":"к","range":[{"line":0,"character":0},{"line":0,"character":1}],"diff":{"type":1,"line":0,"character":0}}
2025-01-11 15:23:01.892 [debug] 1 change(s) to Untitled-1 because undefined
2025-01-11 15:23:01.894 [debug] Set nextStepStartPosition to [0, 0]
2025-01-11 15:23:01.894 [debug] Finished history step with 1 change(s)
Environment:
- Extension (VsCodeVim) version: 1.29.0
- VSCode version: 1.96.2
- OS: Linux (EndeavourOS, kernel 6.12.8)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue identifies the vim.langmap setting and normal-mode r and f commands as the entry points; reproduce the Cyrillic replacement and search behavior with the supplied mapping. Trace langmap handling for these commands and verify that replacement and search respect the current layout without regressing other mappings.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript, vscode
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100