diff options
author | ZyX <kp-pav@yandex.ru> | 2015-04-25 18:47:31 +0300 |
---|---|---|
committer | ZyX <kp-pav@yandex.ru> | 2015-10-08 21:59:51 +0300 |
commit | 244dbe3a77bf548f73d8781da7327f30e818b08a (patch) | |
tree | 8777a25447be219fe351106cfef37670e0278ddd /src/nvim/search.h | |
parent | 0fdaab995ed95250b13058a717d5bc562e1834c8 (diff) | |
download | rneovim-244dbe3a77bf548f73d8781da7327f30e818b08a.tar.gz rneovim-244dbe3a77bf548f73d8781da7327f30e818b08a.tar.bz2 rneovim-244dbe3a77bf548f73d8781da7327f30e818b08a.zip |
viminfo: First version of ShaDa file dumping
What works:
1. ShaDa file dumping: header, registers, jump list, history, search patterns,
substitute strings, variables.
2. ShaDa file reading: registers, global marks, variables.
Most was not tested.
TODO:
1. Merging.
2. Reading history, local marks, jump and buffer lists.
3. Documentation update.
4. Converting some data from &encoding.
5. Safer variant of dumping viminfo (dump to temporary file then rename).
6. Removing old viminfo code (currently masked with `#if 0` in a ShaDa file for
reference).
Diffstat (limited to 'src/nvim/search.h')
-rw-r--r-- | src/nvim/search.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/search.h b/src/nvim/search.h index 1bcde2c7ab..691782e41c 100644 --- a/src/nvim/search.h +++ b/src/nvim/search.h @@ -1,6 +1,9 @@ #ifndef NVIM_SEARCH_H #define NVIM_SEARCH_H +#include <stdbool.h> +#include <stdint.h> + /* Values for the find_pattern_in_path() function args 'type' and 'action': */ #define FIND_ANY 1 #define FIND_DEFINE 2 @@ -39,6 +42,27 @@ #define RE_BOTH 2 /* save pat in both patterns */ #define RE_LAST 2 /* use last used pattern if "pat" is NULL */ +/// Structure containing offset definition for the last search pattern +/// +/// @note Only offset for the last search pattern is used, not for the last +/// substitute pattern. +typedef struct soffset { + char dir; ///< Search direction: forward ('/') or backward ('?') + bool line; ///< True if search has line offset. + bool end; ///< True if search sets cursor at the end. + int64_t off; ///< Actual offset value. +} SearchOffset; + +/// Structure containing last search pattern and its attributes. +typedef struct spat { + char_u *pat; ///< The pattern (in allocated memory) or NULL. + bool magic; ///< Magicness of the pattern. + bool no_scs; ///< No smartcase for this pattern. + Timestamp timestamp; ///< Time of the last change. + SearchOffset off; ///< Pattern offset. + Dictionary *additional_data; ///< Additional data from ShaDa file. +} SearchPattern; + #ifdef INCLUDE_GENERATED_DECLARATIONS # include "search.h.generated.h" #endif |