robin/laufey

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

bfredlMerge pull request #35206 from bfredl/nopreproc_cleanup38986188ba

master
1.0 KiB31 linesraw
1#pragma once
2
3#include <stdbool.h>
4#include <stdint.h>  // IWYU pragma: keep
5
6#include "nvim/api/keysets_defs.h"  // IWYU pragma: keep
7#include "nvim/api/private/defs.h"  // IWYU pragma: keep
8#include "nvim/buffer_defs.h"
9#include "nvim/decoration_defs.h"  // IWYU pragma: keep
10#include "nvim/macros_defs.h"
11#include "nvim/map_defs.h"
12#include "nvim/types_defs.h"
13
14EXTERN Map(String, int) namespace_ids INIT( = MAP_INIT);
15/// Non-global namespaces. A locally-scoped namespace may be "orphaned" if all
16/// window(s) it was scoped to, are destroyed. Such orphans are tracked here to
17/// avoid being mistaken as "global scope".
18EXTERN Set(uint32_t) namespace_localscope INIT( = SET_INIT);
19EXTERN handle_T next_namespace_id INIT( = 1);
20
21/// Returns true if the namespace is global or scoped in the given window.
22static inline bool ns_in_win(uint32_t ns_id, win_T *wp)
23{
24  if (!set_has(uint32_t, &namespace_localscope, ns_id)) {
25    return true;
26  }
27
28  return set_has(uint32_t, &wp->w_ns_set, ns_id);
29}
30
31#include "api/extmark.h.generated.h"