mirror of
https://github.com/neovim/neovim.git
synced 2025-10-13 05:16:09 +00:00
Move exarg_T and cmdarg_T from structs.h to normal.h
This commit is contained in:

committed by
Thiago de Arruda

parent
bd9cd693e7
commit
6089b26016
@@ -6,6 +6,8 @@
|
|||||||
* Do ":help credits" in Vim to see a list of people who contributed.
|
* Do ":help credits" in Vim to see a list of people who contributed.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "normal.h"
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* This file defines the Ex commands.
|
* This file defines the Ex commands.
|
||||||
* When DO_DECLARE_EXCMD is defined, the table with ex command names and
|
* When DO_DECLARE_EXCMD is defined, the table with ex command names and
|
||||||
|
@@ -34,6 +34,7 @@
|
|||||||
#include "crypt.h"
|
#include "crypt.h"
|
||||||
#include "garray.h"
|
#include "garray.h"
|
||||||
#include "move.h"
|
#include "move.h"
|
||||||
|
#include "normal.h"
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
#include "os_unix.h"
|
#include "os_unix.h"
|
||||||
#include "quickfix.h"
|
#include "quickfix.h"
|
||||||
|
@@ -1,6 +1,8 @@
|
|||||||
#ifndef NEOVIM_MAIN_H
|
#ifndef NEOVIM_MAIN_H
|
||||||
#define NEOVIM_MAIN_H
|
#define NEOVIM_MAIN_H
|
||||||
/* main.c */
|
|
||||||
|
#include "normal.h"
|
||||||
|
|
||||||
void main_loop(int cmdwin, int noexmode);
|
void main_loop(int cmdwin, int noexmode);
|
||||||
void getout_preserve_modified(int exitval);
|
void getout_preserve_modified(int exitval);
|
||||||
void getout(int exitval);
|
void getout(int exitval);
|
||||||
|
@@ -25,6 +25,7 @@
|
|||||||
#include "message.h"
|
#include "message.h"
|
||||||
#include "misc1.h"
|
#include "misc1.h"
|
||||||
#include "misc2.h"
|
#include "misc2.h"
|
||||||
|
#include "normal.h"
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
#include "quickfix.h"
|
#include "quickfix.h"
|
||||||
#include "search.h"
|
#include "search.h"
|
||||||
|
@@ -27,6 +27,7 @@
|
|||||||
#include "garray.h"
|
#include "garray.h"
|
||||||
#include "ops.h"
|
#include "ops.h"
|
||||||
#include "option.h"
|
#include "option.h"
|
||||||
|
#include "normal.h"
|
||||||
#include "screen.h"
|
#include "screen.h"
|
||||||
#include "term.h"
|
#include "term.h"
|
||||||
#include "ui.h"
|
#include "ui.h"
|
||||||
|
57
src/normal.h
57
src/normal.h
@@ -1,6 +1,61 @@
|
|||||||
#ifndef NEOVIM_NORMAL_H
|
#ifndef NEOVIM_NORMAL_H
|
||||||
#define NEOVIM_NORMAL_H
|
#define NEOVIM_NORMAL_H
|
||||||
/* normal.c */
|
|
||||||
|
#include "pos.h"
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Arguments for operators.
|
||||||
|
*/
|
||||||
|
typedef struct oparg_S {
|
||||||
|
int op_type; /* current pending operator type */
|
||||||
|
int regname; /* register to use for the operator */
|
||||||
|
int motion_type; /* type of the current cursor motion */
|
||||||
|
int motion_force; /* force motion type: 'v', 'V' or CTRL-V */
|
||||||
|
int use_reg_one; /* TRUE if delete uses reg 1 even when not
|
||||||
|
linewise */
|
||||||
|
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()) */
|
||||||
|
pos_T start; /* start of the operator */
|
||||||
|
pos_T end; /* end of the operator */
|
||||||
|
pos_T cursor_start; /* cursor position before motion for "gw" */
|
||||||
|
|
||||||
|
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 */
|
||||||
|
long prev_opcount; /* ca.opcount saved for K_CURSORHOLD */
|
||||||
|
long prev_count0; /* ca.count0 saved for K_CURSORHOLD */
|
||||||
|
} oparg_T;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Arguments for Normal mode commands.
|
||||||
|
*/
|
||||||
|
typedef struct cmdarg_S {
|
||||||
|
oparg_T *oap; /* Operator arguments */
|
||||||
|
int prechar; /* prefix character (optional, always 'g') */
|
||||||
|
int cmdchar; /* command character */
|
||||||
|
int nchar; /* next command character (optional) */
|
||||||
|
int ncharC1; /* first composing character (optional) */
|
||||||
|
int ncharC2; /* second composing character (optional) */
|
||||||
|
int extra_char; /* yet another character (optional) */
|
||||||
|
long opcount; /* count before an operator */
|
||||||
|
long count0; /* count before command, default 0 */
|
||||||
|
long count1; /* count before command, default 1 */
|
||||||
|
int arg; /* extra argument from nv_cmds[] */
|
||||||
|
int retval; /* return: CA_* values */
|
||||||
|
char_u *searchbuf; /* return: pointer to search pattern or NULL */
|
||||||
|
} cmdarg_T;
|
||||||
|
|
||||||
|
/* values for retval: */
|
||||||
|
#define CA_COMMAND_BUSY 1 /* skip restarting edit() once */
|
||||||
|
#define CA_NO_ADJ_OP_END 2 /* don't adjust operator end */
|
||||||
|
|
||||||
void init_normal_cmds(void);
|
void init_normal_cmds(void);
|
||||||
void normal_cmd(oparg_T *oap, int toplevel);
|
void normal_cmd(oparg_T *oap, int toplevel);
|
||||||
void do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank);
|
void do_pending_operator(cmdarg_T *cap, int old_col, int gui_yank);
|
||||||
|
@@ -1722,68 +1722,8 @@ struct window_S {
|
|||||||
* In a non-location list window, w_llist_ref is NULL.
|
* In a non-location list window, w_llist_ref is NULL.
|
||||||
*/
|
*/
|
||||||
qf_info_T *w_llist_ref;
|
qf_info_T *w_llist_ref;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/*
|
|
||||||
* Arguments for operators.
|
|
||||||
*/
|
|
||||||
typedef struct oparg_S {
|
|
||||||
int op_type; /* current pending operator type */
|
|
||||||
int regname; /* register to use for the operator */
|
|
||||||
int motion_type; /* type of the current cursor motion */
|
|
||||||
int motion_force; /* force motion type: 'v', 'V' or CTRL-V */
|
|
||||||
int use_reg_one; /* TRUE if delete uses reg 1 even when not
|
|
||||||
linewise */
|
|
||||||
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()) */
|
|
||||||
pos_T start; /* start of the operator */
|
|
||||||
pos_T end; /* end of the operator */
|
|
||||||
pos_T cursor_start; /* cursor position before motion for "gw" */
|
|
||||||
|
|
||||||
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 */
|
|
||||||
long prev_opcount; /* ca.opcount saved for K_CURSORHOLD */
|
|
||||||
long prev_count0; /* ca.count0 saved for K_CURSORHOLD */
|
|
||||||
} oparg_T;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Arguments for Normal mode commands.
|
|
||||||
*/
|
|
||||||
typedef struct cmdarg_S {
|
|
||||||
oparg_T *oap; /* Operator arguments */
|
|
||||||
int prechar; /* prefix character (optional, always 'g') */
|
|
||||||
int cmdchar; /* command character */
|
|
||||||
int nchar; /* next command character (optional) */
|
|
||||||
int ncharC1; /* first composing character (optional) */
|
|
||||||
int ncharC2; /* second composing character (optional) */
|
|
||||||
int extra_char; /* yet another character (optional) */
|
|
||||||
long opcount; /* count before an operator */
|
|
||||||
long count0; /* count before command, default 0 */
|
|
||||||
long count1; /* count before command, default 1 */
|
|
||||||
int arg; /* extra argument from nv_cmds[] */
|
|
||||||
int retval; /* return: CA_* values */
|
|
||||||
char_u *searchbuf; /* return: pointer to search pattern or NULL */
|
|
||||||
} cmdarg_T;
|
|
||||||
|
|
||||||
/* values for retval: */
|
|
||||||
#define CA_COMMAND_BUSY 1 /* skip restarting edit() once */
|
|
||||||
#define CA_NO_ADJ_OP_END 2 /* don't adjust operator end */
|
|
||||||
|
|
||||||
#ifdef CURSOR_SHAPE
|
#ifdef CURSOR_SHAPE
|
||||||
/*
|
/*
|
||||||
* struct to store values from 'guicursor' and 'mouseshape'
|
* struct to store values from 'guicursor' and 'mouseshape'
|
||||||
|
Reference in New Issue
Block a user