diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-12-16 18:27:02 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-12-16 18:27:02 +0100 |
commit | 7e1652c63c96585b9e2235c195a3c322b1f11595 (patch) | |
tree | ed90a314ef58909b1c9dfbd45422f1a3557de278 /src/fileio.c | |
parent | 6621605eb97cf5fbc481282fd4d349a76e168f16 (diff) | |
download | vim-git-7e1652c63c96585b9e2235c195a3c322b1f11595.tar.gz |
patch 8.0.1394: cannot intercept a yank commandv8.0.1394
Problem: Cannot intercept a yank command.
Solution: Add the TextYankPost autocommand event. (Philippe Vaucher et al.,
closes #2333)
Diffstat (limited to 'src/fileio.c')
-rw-r--r-- | src/fileio.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/fileio.c b/src/fileio.c index fb49f28f8..ba9ec9ec0 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -6478,6 +6478,7 @@ buf_modname( /* * Like fgets(), but if the file line is too long, it is truncated and the * rest of the line is thrown away. Returns TRUE for end-of-file. + * If the line is truncated then buf[size - 2] will not be NUL. */ int vim_fgets(char_u *buf, int size, FILE *fp) @@ -7856,6 +7857,7 @@ static struct event_name {"WinEnter", EVENT_WINENTER}, {"WinLeave", EVENT_WINLEAVE}, {"VimResized", EVENT_VIMRESIZED}, + {"TextYankPost", EVENT_TEXTYANKPOST}, {NULL, (event_T)0} }; @@ -9400,6 +9402,15 @@ has_funcundefined(void) } /* + * Return TRUE when there is a TextYankPost autocommand defined. + */ + int +has_textyankpost(void) +{ + return (first_autopat[(int)EVENT_TEXTYANKPOST] != NULL); +} + +/* * Execute autocommands for "event" and file name "fname". * Return TRUE if some commands were executed. */ |