robin/laufey

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

Justin M. KeyesMerge #41045 from justinmk/refactoroptionsb9d732c249

master
1.8 KiB58 linesraw
1#pragma once
2
3#include <stdio.h>  // IWYU pragma: keep
4
5#include "nvim/api/private/defs.h"  // IWYU pragma: keep
6#include "nvim/api/private/helpers.h"
7#include "nvim/cmdexpand_defs.h"  // IWYU pragma: keep
8#include "nvim/eval/typval_defs.h"  // IWYU pragma: keep
9#include "nvim/ex_cmds_defs.h"  // IWYU pragma: keep
10#include "nvim/macros_defs.h"
11#include "nvim/option_defs.h"  // IWYU pragma: keep
12#include "nvim/types_defs.h"  // IWYU pragma: keep
13
14/// flags for buf_copy_options()
15enum {
16  BCO_ENTER  = 1,  ///< going to enter the buffer
17  BCO_ALWAYS = 2,  ///< always copy the options
18  BCO_NOHELP = 4,  ///< don't touch the help related options
19};
20
21/// Flags for option-setting functions
22///
23/// When OPT_GLOBAL and OPT_LOCAL are both missing, set both local and global
24/// values, get local value.
25typedef enum {
26  OPT_GLOBAL    = 0x01,  ///< Use global value.
27  OPT_LOCAL     = 0x02,  ///< Use local value.
28  OPT_MODELINE  = 0x04,  ///< Option in modeline.
29  OPT_WINONLY   = 0x08,  ///< Only set window-local options.
30  OPT_NOWIN     = 0x10,  ///< Don’t set window-local options.
31  OPT_ONECOLUMN = 0x20,  ///< list options one per line
32  OPT_NO_REDRAW = 0x40,  ///< ignore redraw flags on option
33  OPT_SKIPRTP   = 0x80,  ///< "skiprtp" in 'sessionoptions'
34} OptionSetFlags;
35
36/// :set boolean option prefix
37typedef enum {
38  PREFIX_NO = 0,  ///< "no" prefix
39  PREFIX_NONE,    ///< no prefix
40  PREFIX_INV,     ///< "inv" prefix
41} set_prefix_T;
42
43/// Gets the option-domain name of an option's type.
44static inline const char *optval_type_name(const ObjectType type)
45{
46  switch (type) {
47  case kObjectTypeBoolean:
48    return "boolean";
49  case kObjectTypeInteger:
50    return "number";
51  case kObjectTypeString:
52    return "string";
53  default:
54    abort();
55  }
56}
57
58#include "option.h.generated.h"