Add v:event.visual during TextYankPost (#12382)

* propagate visual selection to textyankpost event

* adapt tests

* add docs

* also adapt oldtest
This commit is contained in:
Christian Clason
2020-06-03 16:51:25 +02:00
committed by GitHub
parent 60c581b35d
commit 8a1276005a
6 changed files with 48 additions and 21 deletions

View File

@@ -2748,6 +2748,10 @@ static void do_autocmd_textyankpost(oparg_T *oap, yankreg_T *reg)
buf[1] = NUL;
tv_dict_add_str(dict, S_LEN("operator"), buf);
// Selection type: visual or not.
tv_dict_add_special(dict, S_LEN("visual"),
oap->is_VIsual ? kSpecialVarTrue : kSpecialVarFalse);
tv_dict_set_keys_readonly(dict);
textlock++;
apply_autocmds(EVENT_TEXTYANKPOST, NULL, NULL, false, curbuf);