diff options
author | James McCoy <jamessan@jamessan.com> | 2020-08-08 08:57:35 -0400 |
---|---|---|
committer | James McCoy <jamessan@jamessan.com> | 2020-08-08 08:57:35 -0400 |
commit | 840c12c10741d8f70e1787534fb6ea6d2b70edee (patch) | |
tree | f89ad27acbbf0b36db7ac08eeae0b8362da1fabb /src/nvim/extmark.h | |
parent | e813ec79c201c85c5af3b10c051ae92ab5cb8606 (diff) | |
parent | f26df8bb66158baacb79c79822babaf137607cd6 (diff) | |
download | rneovim-840c12c10741d8f70e1787534fb6ea6d2b70edee.tar.gz rneovim-840c12c10741d8f70e1787534fb6ea6d2b70edee.tar.bz2 rneovim-840c12c10741d8f70e1787534fb6ea6d2b70edee.zip |
Merge remote-tracking branch 'upstream/master' into libcallnr
Diffstat (limited to 'src/nvim/extmark.h')
-rw-r--r-- | src/nvim/extmark.h | 93 |
1 files changed, 93 insertions, 0 deletions
diff --git a/src/nvim/extmark.h b/src/nvim/extmark.h new file mode 100644 index 0000000000..b5eb0db3b6 --- /dev/null +++ b/src/nvim/extmark.h @@ -0,0 +1,93 @@ +#ifndef NVIM_EXTMARK_H +#define NVIM_EXTMARK_H + +#include "nvim/buffer_defs.h" +#include "nvim/extmark_defs.h" +#include "nvim/marktree.h" + +EXTERN int extmark_splice_pending INIT(= 0); + +typedef struct +{ + uint64_t ns_id; + uint64_t mark_id; + int row; + colnr_T col; +} ExtmarkInfo; + +typedef kvec_t(ExtmarkInfo) ExtmarkArray; + + +// delete the columns between mincol and endcol +typedef struct { + int start_row; + colnr_T start_col; + int oldextent_row; + colnr_T oldextent_col; + int newextent_row; + colnr_T newextent_col; +} ExtmarkSplice; + +// adjust marks after :move operation +typedef struct { + int start_row; + int start_col; + int extent_row; + int extent_col; + int new_row; + int new_col; +} ExtmarkMove; + +// extmark was updated +typedef struct { + uint64_t mark; // raw mark id of the marktree + int old_row; + colnr_T old_col; + int row; + colnr_T col; +} ExtmarkSavePos; + +typedef enum { + kExtmarkSplice, + kExtmarkMove, + kExtmarkUpdate, + kExtmarkSavePos, + kExtmarkClear, +} UndoObjectType; + +// TODO(bfredl): reduce the number of undo action types +struct undo_object { + UndoObjectType type; + union { + ExtmarkSplice splice; + ExtmarkMove move; + ExtmarkSavePos savepos; + } data; +}; + + +typedef struct { + int start_row; + int start_col; + int end_row; + int end_col; + int attr_id; + VirtText *virt_text; +} HlRange; + +typedef struct { + MarkTreeIter itr[1]; + kvec_t(HlRange) active; + int top_row; + int row; + int col_until; + int current; + VirtText *virt_text; +} DecorationRedrawState; + + +#ifdef INCLUDE_GENERATED_DECLARATIONS +# include "extmark.h.generated.h" +#endif + +#endif // NVIM_EXTMARK_H |