3

I would like to make some modification to the code of this plugin.

It adds / changes some default keybindings. Among them are <C-b> and <C-f> which move the cursor one character to the left / right.

The problem is they break the undo sequence, because they are mapped to <Left> and <Right>. The solution is to prefix them with <C-g>U.

However, I don't know in which version and which patch <C-g>U appeared in Vim.

I tried :helpgrep CTRL-G.*U which gave me 5 results in the quickfix list, but none of them gave me the info.

So I have 2 questions:

  • How can I find precisely when <C-g>U appeared in Vim?
  • How can I reliably test in a script if vim supports it?

Let's say I find out that <C-g>U appeared in Vim 7.4.567, would the following line be the proper way to test?:

if v:version > 704 || v:version == 704 && has("patch567")
5
  • 2
    I use if (v:version == 704 && has("patch393")) || v:version > 704 with set renderoptions and seems to work pretty well.
    – VanLaser
    Jan 6, 2016 at 20:55
  • 1
    For the 1st issue, i used Google :D groups.google.com/forum/#!topic/vim_dev/uZbngIYTl5M
    – VanLaser
    Jan 6, 2016 at 20:57
  • 1
    Thank you very much! So I just need to find out when <C-g>U was added...
    – saginaw
    Jan 6, 2016 at 20:58
  • 1
    Ah ok so it was in patch 849, thank you very much again. If you post it as an answer I'll accept it. Could you briefly explain how you found it on vim_dev ? I'm not used to this site.
    – saginaw
    Jan 6, 2016 at 21:00
  • 1
    romainl's answer is ok - i just used quoted text from the relevant vim's help section to search on google.
    – VanLaser
    Jan 6, 2016 at 21:02

2 Answers 2

3

You can find all the patches on Vim's FTP server. <C-g>U was added in patch 7.4.849.

4

I simply use has('patch-7.4.849') in lh-brackets. This is enough.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.