shada: Add support for merging everything like described in the doc

This commit is contained in:
ZyX
2015-07-19 21:23:15 +03:00
parent 4bc053facd
commit 43fe98c9fb
7 changed files with 896 additions and 463 deletions

View File

@@ -1,6 +1,8 @@
#ifndef NVIM_MARK_H
#define NVIM_MARK_H
#include "nvim/macros.h"
#include "nvim/ascii.h"
#include "nvim/buffer_defs.h"
#include "nvim/mark_defs.h"
#include "nvim/memory.h"
@@ -46,6 +48,32 @@
SET_FMARK(&(xfmarkp__->fmark), mark_, fnum_); \
} while (0)
/// Convert mark name to the offset
static inline int mark_global_index(const char name)
FUNC_ATTR_CONST
{
return (ASCII_ISUPPER(name)
? (name - 'A')
: (ascii_isdigit(name)
? (NMARKS + (name - '0'))
: -1));
}
/// Convert local mark name to the offset
static inline int mark_local_index(const char name)
FUNC_ATTR_CONST
{
return (ASCII_ISLOWER(name)
? (name - 'a')
: (name == '"'
? NMARKS
: (name == '^'
? NMARKS + 1
: (name == '.'
? NMARKS + 2
: -1))));
}
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "mark.h.generated.h"
#endif