search.h
Go to the documentation of this file.
1 #ifndef NVIM_SEARCH_H
2 #define NVIM_SEARCH_H
3 
4 #include <stdbool.h>
5 #include <stdint.h>
6 
7 #include "nvim/vim.h"
8 #include "nvim/buffer_defs.h"
9 #include "nvim/eval/typval.h"
10 #include "nvim/normal.h"
11 #include "nvim/os/time.h"
12 
13 /* Values for the find_pattern_in_path() function args 'type' and 'action': */
14 #define FIND_ANY 1
15 #define FIND_DEFINE 2
16 #define CHECK_PATH 3
17 
18 #define ACTION_SHOW 1
19 #define ACTION_GOTO 2
20 #define ACTION_SPLIT 3
21 #define ACTION_SHOW_ALL 4
22 #define ACTION_EXPAND 5
23 
24 // Values for 'options' argument in do_search() and searchit()
25 #define SEARCH_REV 0x01
26 #define SEARCH_ECHO 0x02
27 #define SEARCH_MSG 0x0c
28 #define SEARCH_NFMSG 0x08
29 #define SEARCH_OPT 0x10
30 #define SEARCH_HIS 0x20
31 #define SEARCH_END 0x40
32 #define SEARCH_NOOF 0x80
33 #define SEARCH_START 0x100
34 #define SEARCH_MARK 0x200
35 #define SEARCH_KEEP 0x400
36 #define SEARCH_PEEK 0x800
37 #define SEARCH_COL 0x1000
38 
39 /* Values for flags argument for findmatchlimit() */
40 #define FM_BACKWARD 0x01 /* search backwards */
41 #define FM_FORWARD 0x02 /* search forwards */
42 #define FM_BLOCKSTOP 0x04 /* stop at start/end of block */
43 #define FM_SKIPCOMM 0x08 /* skip comments */
44 
45 /* Values for sub_cmd and which_pat argument for search_regcomp() */
46 /* Also used for which_pat argument for searchit() */
47 #define RE_SEARCH 0 /* save/use pat in/from search_pattern */
48 #define RE_SUBST 1 /* save/use pat in/from subst_pattern */
49 #define RE_BOTH 2 /* save pat in both patterns */
50 #define RE_LAST 2 /* use last used pattern if "pat" is NULL */
51 
56 typedef struct soffset {
57  char dir;
58  bool line;
59  bool end;
60  int64_t off;
61 } SearchOffset;
62 
64 typedef struct spat {
66  bool magic;
67  bool no_scs;
72 
73 #ifdef INCLUDE_GENERATED_DECLARATIONS
74 # include "search.h.generated.h"
75 #endif
76 #endif // NVIM_SEARCH_H
struct spat SearchPattern
Structure containing last search pattern and its attributes.
Timestamp timestamp
Time of the last change.
Definition: search.h:68
dict_T * additional_data
Additional data from ShaDa file.
Definition: search.h:70
Definition: search.h:56
struct soffset SearchOffset
Definition: coverity-model.c:66
bool end
True if search sets cursor at the end.
Definition: search.h:59
Structure containing last search pattern and its attributes.
Definition: search.h:64
bool magic
Magicness of the pattern.
Definition: search.h:66
bool no_scs
No smartcase for this pattern.
Definition: search.h:67
unsigned char char_u
Definition: types.h:11
bool line
True if search has line offset.
Definition: search.h:58
char dir
Search direction: forward (&#39;/&#39;) or backward (&#39;?&#39;)
Definition: search.h:57
SearchOffset off
Pattern offset.
Definition: search.h:69
int64_t off
Actual offset value.
Definition: search.h:60
char_u * pat
The pattern (in allocated memory) or NULL.
Definition: search.h:65
uint64_t Timestamp
Definition: time.h:8