airblade / airblade/vim-gitgutter

key map expr needs more backslashes?

Open
#889 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Vim Script
Stars
8.5k
Forks
299
PR merge metrics
No merged PRs in 30d

Description

vim: Debian VIM - Vi IMproved 9.1
vim-gitgutter: 67ef116100b40f9ca128196504a2e0bc0a2753b0

Seems strange I'm encountering this if nobody else is, but in the map expr lines such as nnoremap <silent> <expr> <Plug>(GitGutterNextHunk) [...] I needed to change the escape sequences such as \<CR> to \\\<CR>. Without adding extra backslashes I just get literal <CR> strings in the command buffer.

Patch attached in case HTML escaping also eats backslashes.

map.txt

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the attached map.txt and reproduce the mappings on Vim 9.1 using the gitgutter revision given in the report. Trace how the map-expr lines handle the escaped sequences; done means the mappings execute correctly rather than leaving literal escape strings in the command buffer.

Written by the indexing model from the issue text.

Assessment

Tech stack
vim
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.