Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(api): enable nvim_exec_autocmds to pass arbitrary data#18613

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gpanders merged 3 commits intoneovim:masterfromgpanders:autocmd-data
May 18, 2022
Merged
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
fixup! feat(api): enable nvim_exec_autocmds to pass arbitrary data
  • Loading branch information
@gpanders
gpanders committedMay 17, 2022
commit70dbdfea1dabde56a1bf4f2e68ad027fd47e938a
2 changes: 1 addition & 1 deletionsrc/nvim/api/autocmd.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -760,7 +760,7 @@ void nvim_exec_autocmds(Object event, Dict(exec_autocmds) *opts, Error *err)
bool set_buf = false;

char *pattern = NULL;
void *data = NULL;
Object *data = NULL;
bool set_pattern = false;

Array event_array = ARRAY_DICT_INIT;
Expand Down
4 changes: 2 additions & 2 deletionssrc/nvim/autocmd.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1595,7 +1595,7 @@ bool trigger_cursorhold(void) FUNC_ATTR_PURE FUNC_ATTR_WARN_UNUSED_RESULT
///
/// @return true if some commands were executed.
bool apply_autocmds_group(event_T event, char *fname, char *fname_io, bool force, int group,
buf_T *buf, exarg_T *eap,void *data)
buf_T *buf, exarg_T *eap,Object *data)
{
char *sfname = NULL; // short file name
bool retval = false;
Expand DownExpand Up@@ -2030,7 +2030,7 @@ static bool call_autocmd_callback(const AutoCmd *ac, const AutoPatCmd *apc)
PUT(data, "buf", INTEGER_OBJ(autocmd_bufnr));

if (apc->data) {
PUT(data, "data", copy_object(*(Object *)apc->data));
PUT(data, "data", copy_object(*apc->data));
}

int group = apc->curpat->group;
Expand Down
2 changes: 1 addition & 1 deletionsrc/nvim/autocmd.h
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -57,7 +57,7 @@ typedef struct AutoPatCmd {
char *tail; // tail of fname
event_T event; // current event
int arg_bufnr; // initially equal to <abuf>, set to zero when buf is deleted
void *data; // arbitrary data
Object *data; // arbitrary data
struct AutoPatCmd *next; // chain of active apc-s for auto-invalidation
} AutoPatCmd;

Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp