Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update some mappings #271

Merged
merged 1 commit into from
Feb 27, 2024
Merged

update some mappings #271

merged 1 commit into from
Feb 27, 2024

Conversation

jdhao
Copy link
Owner

@jdhao jdhao commented Feb 27, 2024

  1. fix a typo in gJ mapping when setting the mark, the correct syntax is mz (set mark z), not zm

  2. fix bug with iB text object: previously viB does not work as expected, because it does not select the entire buffer as expected. After much investigation, I found it is because the <cmd> mapping argument. If we use <cmd> argument for mapping, the mode does not change. So if we use viB, inititally we are still in visual mode. Later in the implementation, when we use normal! `<V`> to select the entire buffer, it interferes with original visual mode. As a result, the entire buffer is not selected. In the text obj implementation, we can use exe "normal! \<Esc>" to clear the visual mode and make viB, but this is not ideal. I think it is eaiser to just not use the <cmd> argument and use :<C-U> instead.

1. fix a typo in gJ mapping when setting the mark, the correct syntax is
   `mz` (set mark `z`), not `zm`

2. fix bug with `iB` text object: previously `viB` does not work as
   expected, because it does not select the entire buffer as expected.
   After much investigation, I found it is because the `<cmd>` mapping
   argument. If we use `<cmd>` argument for mapping, the mode does not
   change. So if we use `viB`, inititally we are still in visual mode.
   Later in the implementation, when we use `` normal! `<V`>  `` to
   select the entire buffer, it interferes with original visual mode. As
   a result, the entire buffer is not selected. In the text obj
   implementation, we can use `exe "normal! \<Esc>"` to clear the visual
   mode and make `viB`, but this is not ideal. I think it is eaiser to
   just not use the `<cmd>` argument and use `:<C-U>` instead.
@jdhao jdhao merged commit 2f84826 into master Feb 27, 2024
@jdhao jdhao deleted the update-mapping branch February 27, 2024 22:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant