vim: Implement named registers (#12895)

Release Notes:

- vim: Add support for register selection `"a`-`"z`, `"0`-`"9`, `"-`.
`"_` and `"%`
([#11511](https://github.com/zed-industries/zed/issues/11511))

---------

Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
Paul Eguisier 2024-06-12 18:40:27 +02:00 committed by GitHub
parent 3c3dad6830
commit 001f17c011
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 454 additions and 66 deletions

View file

@ -39,9 +39,17 @@ impl ModeIndicator {
fn current_operators_description(&self, vim: &Vim) -> String {
vim.state()
.operator_stack
.iter()
.map(|item| item.id())
.pre_count
.map(|count| format!("{}", count))
.into_iter()
.chain(vim.state().selected_register.map(|reg| format!("\"{reg}")))
.chain(
vim.state()
.operator_stack
.iter()
.map(|item| item.id().to_string()),
)
.chain(vim.state().post_count.map(|count| format!("{}", count)))
.collect::<Vec<_>>()
.join("")
}