robin/laufey
git clone https://git.robinwobin.dev/robin/laufey
2546741d1b
master
1#pragma once 2 3#include <stdbool.h> 4#include <stdint.h> 5 6#include "klib/kvec.h" 7#include "nvim/extmark_defs.h" // IWYU pragma: keep 8#include "nvim/macros_defs.h" 9#include "nvim/marktree_defs.h" 10#include "nvim/pos_defs.h" 11#include "nvim/types_defs.h" // IWYU pragma: keep 12 13EXTERN int curbuf_splice_pending INIT (= 0 ); 14 15typedef kvec_t (MTPair )ExtmarkInfoArray ; 16 17// delete the columns between mincol and endcol 18typedef struct { 19int start_row ; 20colnr_T start_col ; 21int old_row ; 22colnr_T old_col ; 23int new_row ; 24colnr_T new_col ; 25bcount_t start_byte ; 26bcount_t old_byte ; 27bcount_t new_byte ; 28}ExtmarkSplice ; 29 30// adjust marks after :move operation 31typedef struct { 32int start_row ; 33int start_col ; 34int extent_row ; 35int extent_col ; 36int new_row ; 37int new_col ; 38bcount_t start_byte ; 39bcount_t extent_byte ; 40bcount_t new_byte ; 41}ExtmarkMove ; 42 43// extmark was updated 44typedef struct { 45uint64_t mark ;// raw mark id of the marktree 46int undo_row ; 47colnr_T undo_col ; 48int redo_row ;// -1: nothing to redo (the mark was not explicitly moved). 49colnr_T redo_col ; 50bool invalidated ; 51}ExtmarkSavePos ; 52 53typedef enum { 54kExtmarkSplice , 55kExtmarkMove , 56kExtmarkUpdate , 57kExtmarkSavePos , 58kExtmarkClear , 59}UndoObjectType ; 60 61// TODO(bfredl): if possible unify these with marktree flags, 62// so it is possible to filter extmarks directly on top-level flags 63typedef enum { 64kExtmarkNone = 0x1 , 65kExtmarkSign = 0x2 , 66kExtmarkSignHL = 0x4 , 67kExtmarkVirtText = 0x8 , 68kExtmarkVirtLines = 0x10 , 69kExtmarkHighlight = 0x20 , 70}ExtmarkType ; 71 72// TODO(bfredl): reduce the number of undo action types 73struct undo_object { 74UndoObjectType type ; 75union { 76ExtmarkSplice splice ; 77ExtmarkMove move ; 78ExtmarkSavePos savepos ; 79 }data ; 80}; 81 82#include "extmark.h.generated.h"