robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. KeyesMerge #40661 from justinmk/unifyctxedb043bf33

master
2.6 KiB63 linesraw
1#pragma once
2
3#include <stdbool.h>
4#include <stddef.h>  // IWYU pragma: keep
5#include <stdint.h>  // IWYU pragma: keep
6
7#include "klib/kvec.h"
8#include "nvim/api/private/defs.h"  // IWYU pragma: keep
9#include "nvim/autocmd_defs.h"  // IWYU pragma: keep
10#include "nvim/buffer_defs.h"
11#include "nvim/cmdexpand_defs.h"  // IWYU pragma: keep
12#include "nvim/eval/typval_defs.h"  // IWYU pragma: keep
13#include "nvim/event/defs.h"
14#include "nvim/ex_cmds_defs.h"  // IWYU pragma: keep
15#include "nvim/macros_defs.h"
16#include "nvim/pos_defs.h"
17#include "nvim/types_defs.h"
18
19/// For CursorMoved event
20EXTERN win_T *last_cursormoved_win INIT( = NULL);
21/// For CursorMoved event, only used when last_cursormoved_win == curwin
22EXTERN pos_T last_cursormoved INIT( = { 0, 0, 0 });
23
24EXTERN bool autocmd_busy INIT( = false);     ///< Is apply_autocmds() busy?
25EXTERN int autocmd_no_enter INIT( = false);  ///< Buf/WinEnter autocmds disabled
26EXTERN int autocmd_no_leave INIT( = false);  ///< Buf/WinLeave autocmds disabled
27
28/// When deleting the current buffer, another one must be loaded.
29/// If we know which one is preferred, au_new_curbuf is set to it.
30EXTERN bufref_T au_new_curbuf INIT( = { NULL, 0, 0 });
31
32// When deleting a buffer/window and autocmd_busy is true, do not free the
33// buffer/window. but link it in the list starting with
34// au_pending_free_buf/ap_pending_free_win, using b_next/w_next.
35// Free the buffer/window when autocmd_busy is being set to false.
36EXTERN buf_T *au_pending_free_buf INIT( = NULL);
37EXTERN win_T *au_pending_free_win INIT( = NULL);
38
39EXTERN char *autocmd_fname INIT( = NULL);       ///< fname for <afile> on cmdline
40EXTERN bool autocmd_fname_full INIT( = false);  ///< autocmd_fname is full path
41EXTERN int autocmd_bufnr INIT( = 0);            ///< fnum for <abuf> on cmdline
42EXTERN char *autocmd_match INIT( = NULL);       ///< name for <amatch> on cmdline
43EXTERN bool did_cursorhold INIT( = true);       ///< set when CursorHold t'gerd
44
45enum {
46  AUGROUP_DEFAULT = -1,  ///< default autocmd group
47  AUGROUP_ERROR   = -2,  ///< erroneous autocmd group
48  AUGROUP_ALL     = -3,  ///< all autocmd groups
49  AUGROUP_DELETED = -4,  ///< all autocmd groups
50  // AUGROUP_NS      = -5,  // TODO(tjdevries): Support namespaced based augroups
51};
52
53enum { BUFLOCAL_PAT_LEN = 25, };
54
55/// Iterates over all the events for auto commands
56#define FOR_ALL_AUEVENTS(event) \
57  for (event_T event = (event_T)0; (int)event < (int)NUM_EVENTS; event = (event_T)((int)event + 1))
58
59/// Stores events for execution until a known safe state.
60/// This should be the default for all new autocommands.
61EXTERN MultiQueue *deferred_events INIT( = NULL);
62
63#include "autocmd.h.generated.h"