From cccb21df3b4c6fe0aaa99743c418aa973aeebad0 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 27 Apr 2024 04:10:59 +0200 Subject: Merging upstream version 2:9.1.0374. Signed-off-by: Daniel Baumann --- src/structs.h | 40 +++++++++++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 3 deletions(-) (limited to 'src/structs.h') diff --git a/src/structs.h b/src/structs.h index 47a0050..36339c4 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1562,9 +1562,10 @@ struct itf2class_S { // array with ints follows }; -#define CLASS_INTERFACE 1 -#define CLASS_EXTENDED 2 // another class extends this one -#define CLASS_ABSTRACT 4 // abstract class +#define CLASS_INTERFACE 0x1 +#define CLASS_EXTENDED 0x2 // another class extends this one +#define CLASS_ABSTRACT 0x4 // abstract class +#define CLASS_ENUM 0x8 // enum // "class_T": used for v_class of typval of VAR_CLASS // Also used for an interface (class_flags has CLASS_INTERFACE). @@ -1613,6 +1614,9 @@ struct class_S type_T class_object_type; // same as class_type but VAR_OBJECT }; +#define IS_INTERFACE(cl) ((cl)->class_flags & CLASS_INTERFACE) +#define IS_ENUM(cl) ((cl)->class_flags & CLASS_ENUM) + // Used for v_object of typval of VAR_OBJECT. // The member variables follow in an array of typval_T. struct object_S @@ -2127,6 +2131,7 @@ typedef struct int sn_state; // SN_STATE_ values char_u *sn_save_cpo; // 'cpo' value when :vim9script found char sn_is_vimrc; // .vimrc file, do not restore 'cpo' + char sn_syml_checked;// flag: this has been checked for sym link // for a Vim9 script under "rtp/autoload/" this is "dir#scriptname#" char_u *sn_autoload_prefix; @@ -3129,6 +3134,19 @@ struct file_buffer int b_marks_read; // Have we read viminfo marks yet? #endif + int b_modified_was_set; // did ":set modified" + int b_did_filetype; // FileType event found + int b_keep_filetype; // value for did_filetype when starting + // to execute autocommands + + // Set by the apply_autocmds_group function if the given event is equal to + // EVENT_FILETYPE. Used by the readfile function in order to determine if + // EVENT_BUFREADPOST triggered the EVENT_FILETYPE. + // + // Relying on this value requires one to reset it prior calling + // apply_autocmds_group(). + int b_au_did_filetype; + /* * The following only used in undo.c. */ @@ -4380,6 +4398,7 @@ typedef struct int new_curwin_id; // ID of new curwin int save_prevwin_id; // ID of saved prevwin bufref_T new_curbuf; // new curbuf + char_u *tp_localdir; // saved value of tp_localdir char_u *globaldir; // saved value of globaldir int save_VIsual_active; // saved VIsual_active int save_State; // saved State @@ -5043,3 +5062,18 @@ typedef struct { linenr_T spv_capcol_lnum; // line number for "cap_col" #endif } spellvars_T; + +// Return the length of a string literal +#define STRLEN_LITERAL(s) (sizeof(s) - 1) + +// Store a key/value pair +typedef struct +{ + int key; // the key + char *value; // the value string + size_t length; // length of the value string +} keyvalue_T; + +#define KEYVALUE_ENTRY(k, v) \ + {(k), (v), STRLEN_LITERAL(v)} + -- cgit v1.2.3