diff options
Diffstat (limited to 'src/nvim/buffer_defs.h')
-rw-r--r-- | src/nvim/buffer_defs.h | 118 |
1 files changed, 63 insertions, 55 deletions
diff --git a/src/nvim/buffer_defs.h b/src/nvim/buffer_defs.h index 0324f6b88a..29f4dfe4fb 100644 --- a/src/nvim/buffer_defs.h +++ b/src/nvim/buffer_defs.h @@ -237,6 +237,8 @@ typedef struct { # define w_p_crb w_onebuf_opt.wo_crb /* 'cursorbind' */ int wo_crb_save; /* 'cursorbind' state saved for diff mode*/ # define w_p_crb_save w_onebuf_opt.wo_crb_save + char_u *wo_scl; +# define w_p_scl w_onebuf_opt.wo_scl // 'signcolumn' int wo_scriptID[WV_COUNT]; /* SIDs for window-local options */ # define w_p_scriptID w_onebuf_opt.wo_scriptID @@ -438,18 +440,23 @@ typedef struct { linenr_T b_sst_check_lnum; uint16_t b_sst_lasttick; /* last display tick */ - /* for spell checking */ - garray_T b_langp; /* list of pointers to slang_T, see spell.c */ - bool b_spell_ismw[256]; /* flags: is midword char */ - char_u *b_spell_ismw_mb; /* multi-byte midword chars */ - char_u *b_p_spc; /* 'spellcapcheck' */ - regprog_T *b_cap_prog; /* program for 'spellcapcheck' */ - char_u *b_p_spf; /* 'spellfile' */ - char_u *b_p_spl; /* 'spelllang' */ - int b_cjk; /* all CJK letters as OK */ + // for spell checking + garray_T b_langp; // list of pointers to slang_T, see spell.c + bool b_spell_ismw[256]; // flags: is midword char + char_u *b_spell_ismw_mb; // multi-byte midword chars + char_u *b_p_spc; // 'spellcapcheck' + regprog_T *b_cap_prog; // program for 'spellcapcheck' + char_u *b_p_spf; // 'spellfile' + char_u *b_p_spl; // 'spelllang' + int b_cjk; // all CJK letters as OK + char_u b_syn_chartab[32]; // syntax iskeyword option + char_u *b_syn_isk; // iskeyword option } synblock_T; +#define BUF_HAS_QF_ENTRY 1 +#define BUF_HAS_LL_ENTRY 2 + /* * buffer: structure that holds information about one file * @@ -459,9 +466,10 @@ typedef struct { */ struct file_buffer { - uint64_t handle; // unique identifier for the buffer - memline_T b_ml; /* associated memline (also contains line - count) */ + handle_T handle; // unique id for the buffer (buffer number) +#define b_fnum handle + + memline_T b_ml; // associated memline (also contains line count buf_T *b_next; /* links in list of buffers */ buf_T *b_prev; @@ -485,11 +493,9 @@ struct file_buffer { bool file_id_valid; FileID file_id; - int b_fnum; /* buffer number for this file. */ - - bool b_changed; /* 'modified': Set to true if something in the - file has been changed and not written out. */ - int b_changedtick; /* incremented for each change, also for undo */ + int b_changed; // 'modified': Set to true if something in the + // file has been changed and not written out. + int b_changedtick; // incremented for each change, also for undo bool b_saving; /* Set to true if we are in the middle of saving the buffer. */ @@ -608,6 +614,7 @@ struct file_buffer { int b_p_bomb; ///< 'bomb' char_u *b_p_bh; ///< 'bufhidden' char_u *b_p_bt; ///< 'buftype' + int b_has_qf_entry; ///< quickfix exists for buffer int b_p_bl; ///< 'buflisted' int b_p_cin; ///< 'cindent' char_u *b_p_cino; ///< 'cinoptions' @@ -654,7 +661,7 @@ struct file_buffer { long b_p_sts; ///< 'softtabstop' long b_p_sts_nopaste; ///< b_p_sts saved for paste mode char_u *b_p_sua; ///< 'suffixesadd' - bool b_p_swf; ///< 'swapfile' + int b_p_swf; ///< 'swapfile' long b_p_smc; ///< 'synmaxcol' char_u *b_p_syn; ///< 'syntax' long b_p_ts; ///< 'tabstop' @@ -770,7 +777,7 @@ struct file_buffer { /* * Stuff for diff mode. */ -# define DB_COUNT 4 /* up to four buffers can be diff'ed */ +# define DB_COUNT 8 // up to four buffers can be diff'ed /* * Each diffblock defines where a block of lines starts in each of the buffers @@ -797,28 +804,27 @@ struct diffblock_S { # define SNAP_AUCMD_IDX 1 # define SNAP_COUNT 2 -/* - * Tab pages point to the top frame of each tab page. - * Note: Most values are NOT valid for the current tab page! Use "curwin", - * "firstwin", etc. for that. "tp_topframe" is always valid and can be - * compared against "topframe" to find the current tab page. - */ +/// Tab pages point to the top frame of each tab page. +/// Note: Most values are NOT valid for the current tab page! Use "curwin", +/// "firstwin", etc. for that. "tp_topframe" is always valid and can be +/// compared against "topframe" to find the current tab page. typedef struct tabpage_S tabpage_T; struct tabpage_S { - uint64_t handle; - tabpage_T *tp_next; /* next tabpage or NULL */ - frame_T *tp_topframe; /* topframe for the windows */ - win_T *tp_curwin; /* current window in this Tab page */ - win_T *tp_prevwin; /* previous window in this Tab page */ - win_T *tp_firstwin; /* first window in this Tab page */ - win_T *tp_lastwin; /* last window in this Tab page */ - long tp_old_Rows; /* Rows when Tab page was left */ - long tp_old_Columns; /* Columns when Tab page was left */ - long tp_ch_used; /* value of 'cmdheight' when frame size - was set */ + handle_T handle; + tabpage_T *tp_next; ///< next tabpage or NULL + frame_T *tp_topframe; ///< topframe for the windows + win_T *tp_curwin; ///< current window in this Tab page + win_T *tp_prevwin; ///< previous window in this Tab page + win_T *tp_firstwin; ///< first window in this Tab page + win_T *tp_lastwin; ///< last window in this Tab page + long tp_old_Rows; ///< Rows when Tab page was left + long tp_old_Columns; ///< Columns when Tab page was left + long tp_ch_used; ///< value of 'cmdheight' when frame size + ///< was set + diff_T *tp_first_diff; buf_T *(tp_diffbuf[DB_COUNT]); - int tp_diff_invalid; ///< list of diffs is outdated */ + int tp_diff_invalid; ///< list of diffs is outdated frame_T *(tp_snapshot[SNAP_COUNT]); ///< window layout snapshots dictitem_T tp_winvar; ///< variable for "t:" Dictionary dict_T *tp_vars; ///< internal variables, local to tab page @@ -877,16 +883,17 @@ struct frame_S { * match functions there is a different pattern for each window. */ typedef struct { - regmmatch_T rm; /* points to the regexp program; contains last found - match (may continue in next line) */ - buf_T *buf; /* the buffer to search for a match */ - linenr_T lnum; /* the line to search for a match */ - int attr; /* attributes to be used for a match */ - int attr_cur; /* attributes currently active in win_line() */ - linenr_T first_lnum; /* first lnum to search for multi-line pat */ - colnr_T startcol; /* in win_line() points to char where HL starts */ - colnr_T endcol; /* in win_line() points to char where HL ends */ - proftime_T tm; /* for a time limit */ + regmmatch_T rm; // points to the regexp program; contains last found + // match (may continue in next line) + buf_T *buf; // the buffer to search for a match + linenr_T lnum; // the line to search for a match + int attr; // attributes to be used for a match + int attr_cur; // attributes currently active in win_line() + linenr_T first_lnum; // first lnum to search for multi-line pat + colnr_T startcol; // in win_line() points to char where HL starts + colnr_T endcol; // in win_line() points to char where HL ends + bool is_addpos; // position specified directly by matchaddpos() + proftime_T tm; // for a time limit } match_T; /// number of positions supported by matchaddpos() @@ -934,9 +941,10 @@ struct matchitem { * All row numbers are relative to the start of the window, except w_winrow. */ struct window_S { - uint64_t handle; - buf_T *w_buffer; /* buffer we are a window into (used - often, keep it the first item!) */ + handle_T handle; ///< unique identifier for the window + + buf_T *w_buffer; ///< buffer we are a window into (used + ///< often, keep it the first item!) synblock_T *w_s; /* for :ownsyntax */ @@ -1034,11 +1042,11 @@ struct window_S { */ int w_wrow, w_wcol; /* cursor position in window */ - linenr_T w_botline; /* number of the line below the bottom of - the screen */ - int w_empty_rows; /* number of ~ rows in window */ - int w_filler_rows; /* number of filler rows at the end of the - window */ + linenr_T w_botline; // number of the line below the bottom of + // the window + int w_empty_rows; // number of ~ rows in window + int w_filler_rows; // number of filler rows at the end of the + // window /* * Info about the lines currently in the window is remembered to avoid |