⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 structs.h

📁 VIM文本编辑器
💻 H
📖 第 1 页 / 共 2 页
字号:
    int		     b_visual_mode;	/* VIsual_mode of last VIsual */

    FPOS	     b_last_cursor;	/* cursor position when last unloading
					   this buffer */

    /*
     * Character table, only used in charset.c for 'iskeyword'
     */
    char	     b_chartab[256];

    /*
     * start and end of an operator, also used for '[ and ']
     */
    FPOS	     b_op_start;
    FPOS	     b_op_end;

#ifdef VIMINFO
    int		     b_marks_read;	/* Have we read viminfo marks yet? */
#endif /* VIMINFO */

    /*
     * The following only used in undo.c.
     */
    struct u_header *b_u_oldhead;	/* pointer to oldest header */
    struct u_header *b_u_newhead;	/* pointer to newest header */
    struct u_header *b_u_curhead;	/* pointer to current header */
    int		     b_u_numhead;	/* current number of headers */
    int		     b_u_synced;	/* entry lists are synced */

    /*
     * variables for "U" command in undo.c
     */
    char_u	    *b_u_line_ptr;	/* saved line for "U" command */
    linenr_t	     b_u_line_lnum;	/* line number of line in u_line */
    colnr_t	     b_u_line_colnr;	/* optional column number */

    /*
     * The following only used in undo.c
     */
    struct m_block   b_block_head;	/* head of allocated memory block list */
    info_t	    *b_m_search;	/* pointer to chunk before previously
					 * allocated/freed chunk */
    struct m_block  *b_mb_current;	/* block where m_search points in */
#ifdef INSERT_EXPAND
    int		     b_scanned;		/* ^N/^P have scanned this buffer */
#endif

    /*
     * Options "local" to a buffer.
     * They are here because their value depends on the type of file
     * or contents of the file being edited.
     * The "save" options are for when the paste option is set.
     */
    int		     b_p_initialized;	/* set when options initialized */
    int		     b_p_ai, b_p_ro, b_p_lisp;
    int		     b_p_inf;		/* infer case of ^N/^P completions */
#ifdef INSERT_EXPAND
    char_u	    *b_p_cpt;		/* 'complete', types of expansions */
#endif
    int		     b_p_bin, b_p_eol, b_p_et, b_p_ml, b_p_tx, b_p_swf;
#ifndef SHORT_FNAME
    int		     b_p_sn;
#endif

    long	     b_p_sw, b_p_sts, b_p_ts, b_p_tw, b_p_wm;
    char_u	    *b_p_ff, *b_p_fo, *b_p_com, *b_p_isk;
#ifdef MULTI_BYTE
    char_u	    *b_p_fe;
#endif
    char_u	    *b_p_nf;	    /* Number formats */
    char_u	    *b_p_mps;

    /* saved values for when 'bin' is set */
    long	     b_p_wm_nobin, b_p_tw_nobin;
    int		     b_p_ml_nobin, b_p_et_nobin;

    /* saved values for when 'paste' is set */
    int		     b_p_ai_save, b_p_lisp_save;
    long	     b_p_tw_save, b_p_wm_save, b_p_sts_save;

#ifdef SMARTINDENT
    int		     b_p_si, b_p_si_save;
#endif
#ifdef CINDENT
    int		     b_p_cin;	    /* use C progam indent mode */
    int		     b_p_cin_save;  /* b_p_cin saved for paste mode */
    char_u	    *b_p_cino;	    /* C progam indent mode options */
    char_u	    *b_p_cink;	    /* C progam indent mode keys */
#endif
#if defined(CINDENT) || defined(SMARTINDENT)
    char_u	    *b_p_cinw;	    /* words extra indent for 'si' and 'cin' */
#endif
#ifdef SYNTAX_HL
    char_u	    *b_p_syn;	    /* 'syntax' */
#endif
#ifdef WANT_FILETYPE
    char_u	    *b_p_ft;	    /* Value of 'filetype' option */
#endif
    /* end of buffer options */

    int		     b_start_ffc;   /* first char of 'ff' when edit started */

#ifdef WANT_EVAL
    struct growarray b_vars;	    /* internal variables, local to buffer */
#endif

    /* When a buffer is created, it starts without a swap file.  b_may_swap is
     * then set to indicate that a swap file may be opened later.  It is reset
     * if a swap file could not be opened.
     */
    int		     b_may_swap;
    int		     b_did_warn;    /* Set to 1 if user has been warned on
				     * first change of a read-only file */
    int		     b_help;	    /* buffer for help file */

#ifndef SHORT_FNAME
    int		     b_shortname;   /* this file has an 8.3 file name */
#endif

#ifdef HAVE_PERL_INTERP
    void	    *perl_private;
#endif

#ifdef HAVE_PYTHON
    void	    *python_ref;    /* The Python value referring to
				     * this buffer */
#endif

#ifdef HAVE_TCL
    void	    *tcl_ref;
#endif

#ifdef SYNTAX_HL
    struct keyentry	**b_keywtab;	      /* syntax keywords hash table */
    struct keyentry	**b_keywtab_ic;	      /* idem, ignore case */
    int			b_syn_ic;	      /* ignore case for :syn cmds */
    struct growarray	b_syn_patterns;	      /* table for syntax patterns */
    struct growarray	b_syn_clusters;	      /* table for syntax clusters */
    int			b_syn_sync_flags;     /* flags about how to sync */
    short		b_syn_sync_id;	      /* group to sync on */
    long		b_syn_sync_minlines;  /* minimal sync lines offset */
    long		b_syn_sync_maxlines;  /* maximal sync lines offset */
    char_u		*b_syn_linecont_pat;  /* line continuation pattern */
    vim_regexp		*b_syn_linecont_prog; /* line continuation program */
    int			b_syn_linecont_ic;    /* ignore-case flag for above */
    int			b_syn_topgrp;	      /* for ":syntax include" */
/*
 * b_syn_states[] contains the state stack for a number of consecutive lines,
 * for the start of that line (col == 0).
 * Each position in the stack is an index in b_syn_patterns[].
 * Normally these are the lines currently being displayed.
 * b_syn_states	     is a pointer to an array of struct syn_state.
 * b_syn_states_len  is the number of entries in b_syn_states[].
 * b_syn_states_lnum is the first line that is in b_syn_states[].
 * b_syn_change_lnum is the lowest line number with changes since the last
 *		     update of b_syn_states[] (0 means no changes)
 */
    struct syn_state	*b_syn_states;
    int			b_syn_states_len;
    linenr_t		b_syn_states_lnum;
    linenr_t		b_syn_change_lnum;
#endif /* SYNTAX_HL */
};

/*
 * Structure which contains all information that belongs to a window
 *
 * All row numbers are relative to the start of the window, except w_winpos.
 */
struct window
{
    BUF		*w_buffer;	    /* buffer we are a window into */

    WIN		*w_prev;	    /* link to previous window (above) */
    WIN		*w_next;	    /* link to next window (below) */

    FPOS	w_cursor;	    /* cursor's position in buffer */

    /*
     * w_valid is a bitfield of flags, which indicate if specific values are
     * valid or need to be recomputed.	See screen.c for values.
     */
    int		w_valid;
    FPOS	w_valid_cursor;	    /* last known position of w_cursor, used
				       to adjust w_valid */
    colnr_t	w_valid_leftcol;    /* last known w_leftcol */

    /*
     * w_wrow and w_wcol are the cursor's position in the window.
     * This is related to character positions in the window, not in the file.
     * w_wrow is relative to w_winpos.
     */
    int		w_wrow, w_wcol;	    /* cursor's position in window */

    /*
     * w_cline_height is the number of physical lines taken by the buffer line
     * that the cursor is on.  We use this to avoid extra calls to plines().
     */
    int		w_cline_height;	    /* current size of cursor line */

    int		w_cline_row;	    /* starting row of the cursor line */

    colnr_t	w_virtcol;	    /* column number of the file's actual */
				    /* line, as opposed to the column */
				    /* number we're at on the screen. */
				    /* This makes a difference on lines */
				    /* which span more than one screen */
				    /* line or when w_leftcol is non-zero */

    colnr_t	w_curswant;	    /* The column we'd like to be at. */
				    /* This is used to try to stay in */
				    /* the same column through up/down */
				    /* cursor motions. */

    int		w_set_curswant;	    /* If set, then update w_curswant */
				    /* the next time through cursupdate() */
				    /* to the current virtual column */

    /*
     * the next three are used to update the visual part
     */
    linenr_t	w_old_cursor_lnum;  /* last known end of visual part */
    colnr_t	w_old_cursor_fcol;  /* first column for block visual part */
    colnr_t	w_old_cursor_lcol;  /* last column for block visual part */
    linenr_t	w_old_visual_lnum;  /* last known start of visual part */
    colnr_t	w_old_curswant;	    /* last known value of Curswant */

    linenr_t	w_topline;	    /* number of the line at the top of
				     * the screen */
    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_winpos;	    /* row of topline of window in screen */
    int		w_height;	    /* number of rows in window, excluding
					status/command line */
    int		w_status_height;    /* number of status lines (0 or 1) */

    int		w_redr_status;	    /* if TRUE status line must be redrawn */
    int		w_redr_type;	    /* type of redraw to be performed on win */

    /* remember what is shown in the ruler for this window (if 'ruler' set) */
    FPOS	w_ru_cursor;	    /* cursor position shown in ruler */
    colnr_t	w_ru_virtcol;	    /* virtcol shown in ruler */
    char	w_ru_empty;	    /* TRUE if ruler shows 0-1 (empty line) */

    colnr_t	w_leftcol;	    /* starting column of the screen when
				     * 'wrap' is off */
    colnr_t	w_skipcol;	    /* starting column when a single line
				       doesn't fit in the window */

/*
 * The height of the lines currently in the window is remembered
 * to avoid recomputing it every time. The number of entries is Rows.
 */
    int		w_lsize_valid;	    /* nr. of valid LineSizes */
    linenr_t	*w_lsize_lnum;	    /* array of line numbers for w_lsize */
    char_u	*w_lsize;	    /* array of line heights */

    int		w_alt_fnum;	    /* alternate file (for # and CTRL-^) */

    int		w_arg_idx;	    /* current index in argument list (can be
				     * out of range!) */
    int		w_arg_idx_invalid;  /* editing another file then w_arg_idx */

    /*
     * Variables "local" to a window.
     * They are here because they influence the layout of the window or
     * depend on the window layout.
     */
    int		w_p_list,
		w_p_nu,
#ifdef RIGHTLEFT
		w_p_rl,
#ifdef FKMAP
		w_p_pers,	/* for the window dependent Farsi functions */
#endif
#endif
		w_p_wrap,
		w_p_lbr;
    long	w_p_scroll;

#ifdef WANT_EVAL
    struct growarray w_vars;	    /* internal variables, local to window */
#endif

    /*
     * The w_prev_pcmark field is used to check whether we really did jump to
     * a new line after setting the w_pcmark.  If not, then we revert to
     * using the previous w_pcmark.
     */
    FPOS	w_pcmark;	    /* previous context mark */
    FPOS	w_prev_pcmark;	    /* previous w_pcmark */

    /*
     * the jumplist contains old cursor positions
     */
    struct filemark w_jumplist[JUMPLISTSIZE];
    int		    w_jumplistlen;		/* number of active entries */
    int		    w_jumplistidx;		/* current position */

    /*
     * the tagstack grows from 0 upwards:
     * entry 0: older
     * entry 1: newer
     * entry 2: newest
     */
    struct taggy    w_tagstack[TAGSTACKSIZE];	/* the tag stack */
    int		    w_tagstackidx;		/* idx just below activ entry */
    int		    w_tagstacklen;		/* number of tags on stack */

    /*
     * w_fraction is the fractional row of the cursor within the window, from
     * 0 at the top row to FRACTION_MULT at the last row.
     * w_prev_fraction_row was the actual cursor row when w_fraction was last
     * calculated.
     */
    int		    w_fraction;
    int		    w_prev_fraction_row;

#ifdef USE_GUI
    GuiScrollbar    w_scrollbars[2];		/* Scrollbars for this window */
#endif /* USE_GUI */

#ifdef HAVE_PERL_INTERP
    void	    *perl_private;
#endif

#ifdef HAVE_PYTHON
    void	    *python_ref;    /* The Python value referring to
				     * this window */
#endif

#ifdef HAVE_TCL
    void	    *tcl_ref;
#endif
};

/*
 * Arguments for operators.
 */
typedef struct oparg
{
    int	    op_type;		/* current pending operator type */
    int	    op_prechar;		/* optional character before operator command */
    int	    regname;		/* register to use for the operator */
    int	    motion_type;	/* type of the current cursor motion */
    int	    inclusive;		/* TRUE if char motion is inclusive (only
				   valid when motion_type is MCHAR */
    int	    end_adjusted;	/* backuped b_op_end one char (only used by
				   do_format()) */
    FPOS    start;		/* start of the operator */
    FPOS    end;		/* end of the operator */
    long    line_count;		/* number of lines from op_start to op_end
				   (inclusive) */
    int	    empty;		/* op_start and op_end the same (only used by
				   do_change()) */
    int	    is_VIsual;		/* operator on Visual area */
    int	    block_mode;		/* current operator is Visual block mode */
    colnr_t start_vcol;		/* start col for block mode operator */
    colnr_t end_vcol;		/* end col for block mode operator */
} OPARG;

/*
 * Arguments for Normal mode commands.
 */
typedef struct cmdarg
{
    OPARG   *oap;	    /* Operator arguments */
    int	    prechar;	    /* prefix character (optional, always 'g') */
    int	    cmdchar;	    /* command character */
    int	    nchar;	    /* next character (optional) */
    long    count0;	    /* count, default 0 */
    long    count1;	    /* count, default 1 */
} CMDARG;

#ifdef CURSOR_SHAPE
/*
 * struct to store values from 'guicursor'
 */
#define SHAPE_N		0   /* Normal mode */
#define SHAPE_V		1   /* Visual mode */
#define SHAPE_I		2   /* Insert mode */
#define SHAPE_R		3   /* Replace mode */
#define SHAPE_C		4   /* Command line Normal mode */
#define SHAPE_CI	5   /* Command line Insert mode */
#define SHAPE_CR	6   /* Command line Replace mode */
#define SHAPE_SM	7   /* showing matching paren */
#define SHAPE_O		8   /* Operator-pending mode */
#define SHAPE_VE	9   /* Visual mode with 'seleciton' exclusive */
#define SHAPE_COUNT	10

#define SHAPE_BLOCK	0   /* block cursor */
#define SHAPE_HOR	1   /* horizontal bar cursor */
#define SHAPE_VER	2   /* vertical bar cursor */

struct cursor_entry
{
    int	    shape;	    /* one of the SHAPE_ defines */
    int	    percentage;	    /* percentage of cell for bar */
    long    blinkwait;	    /* blinking, wait time before blinking starts */
    long    blinkon;	    /* blinking, on time */
    long    blinkoff;	    /* blinking, off time */
    int	    id;		    /* highlight group ID */
    char    *name;	    /* mode name (fixed) */
};
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -