1
0
forked from aniani/vim

patch 8.2.1078: highlight and match functionality together in one file

Problem:    Highlight and match functionality together in one file.
Solution:   Move match functionality to a separate file. (Yegappan Lakshmanan,
            closes #6352)
This commit is contained in:
Bram Moolenaar 2020-06-28 13:17:26 +02:00
parent 75e15670b8
commit 06cf97e714
13 changed files with 1396 additions and 1359 deletions

View File

@ -80,6 +80,7 @@ SRC_ALL = \
src/main.c \
src/map.c \
src/mark.c \
src/match.c \
src/mbyte.c \
src/memfile.c \
src/memfile_test.c \
@ -247,6 +248,7 @@ SRC_ALL = \
src/proto/main.pro \
src/proto/map.pro \
src/proto/mark.pro \
src/proto/match.pro \
src/proto/mbyte.pro \
src/proto/memfile.pro \
src/proto/memline.pro \

View File

@ -753,6 +753,7 @@ OBJ = \
$(OUTDIR)/main.o \
$(OUTDIR)/map.o \
$(OUTDIR)/mark.o \
$(OUTDIR)/match.o \
$(OUTDIR)/memfile.o \
$(OUTDIR)/memline.o \
$(OUTDIR)/menu.o \

View File

@ -72,6 +72,7 @@ SRC = arabic.c \
main.c \
map.c \
mark.c \
match.c \
mbyte.c \
memfile.c \
memline.c \

View File

@ -775,6 +775,7 @@ OBJ = \
$(OUTDIR)\main.obj \
$(OUTDIR)\map.obj \
$(OUTDIR)\mark.obj \
$(OUTDIR)\match.obj \
$(OUTDIR)\mbyte.obj \
$(OUTDIR)\memfile.obj \
$(OUTDIR)\memline.obj \
@ -1671,6 +1672,8 @@ $(OUTDIR)/map.obj: $(OUTDIR) map.c $(INCL)
$(OUTDIR)/mark.obj: $(OUTDIR) mark.c $(INCL)
$(OUTDIR)/match.obj: $(OUTDIR) match.c $(INCL)
$(OUTDIR)/memfile.obj: $(OUTDIR) memfile.c $(INCL)
$(OUTDIR)/memline.obj: $(OUTDIR) memline.c $(INCL)
@ -1935,6 +1938,7 @@ proto.h: \
proto/main.pro \
proto/map.pro \
proto/mark.pro \
proto/match.pro \
proto/memfile.pro \
proto/memline.pro \
proto/menu.pro \

View File

@ -347,6 +347,7 @@ SRC = \
main.c \
map.c \
mark.c \
match.c \
mbyte.c \
memfile.c \
memline.c \
@ -460,6 +461,7 @@ OBJ = \
main.obj \
map.obj \
mark.obj \
match.obj \
mbyte.obj \
memfile.obj \
memline.obj \
@ -867,6 +869,9 @@ map.obj : map.c vim.h [.auto]config.h feature.h os_unix.h \
mark.obj : mark.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \
[.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h
match.obj : match.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h gui.h beval.h \
[.proto]gui_beval.pro option.h ex_cmds.h proto.h globals.h
memfile.obj : memfile.c vim.h [.auto]config.h feature.h os_unix.h \
ascii.h keymap.h term.h macros.h structs.h regexp.h \
gui.h beval.h [.proto]gui_beval.pro option.h ex_cmds.h proto.h \

View File

@ -1649,6 +1649,7 @@ BASIC_SRC = \
main.c \
map.c \
mark.c \
match.c \
mbyte.c \
memfile.c \
memline.c \
@ -1797,6 +1798,7 @@ OBJ_COMMON = \
objects/list.o \
objects/map.o \
objects/mark.o \
objects/match.o \
objects/mbyte.o \
objects/memline.o \
objects/menu.o \
@ -1971,6 +1973,7 @@ PRO_AUTO = \
main.pro \
map.pro \
mark.pro \
match.pro \
mbyte.pro \
memfile.pro \
memline.pro \
@ -3379,6 +3382,9 @@ objects/map.o: map.c
objects/mark.o: mark.c
$(CCC) -o $@ mark.c
objects/match.o: match.c
$(CCC) -o $@ match.c
objects/memfile.o: memfile.c
$(CCC) -o $@ memfile.c
@ -3965,6 +3971,10 @@ objects/mark.o: mark.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/match.o: match.c vim.h protodef.h auto/config.h feature.h \
os_unix.h auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \
proto.h globals.h
objects/mbyte.o: mbyte.c vim.h protodef.h auto/config.h feature.h os_unix.h \
auto/osdef.h ascii.h keymap.h term.h macros.h option.h beval.h \
proto/gui_beval.pro structs.h regexp.h gui.h alloc.h ex_cmds.h spell.h \

View File

@ -51,8 +51,9 @@ getchar.c | getting characters and key mapping
highlight.c | syntax highlighting
indent.c | text indentation
insexpand.c | Insert mode completion
mark.c | marks
map.c | mapping and abbreviations
mark.c | marks
match.c | highlight matching
mbyte.c | multi-byte character handling
memfile.c | storing lines for buffers in a swapfile
memline.c | storing lines for buffers in memory

File diff suppressed because it is too large Load Diff

1351
src/match.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -104,6 +104,7 @@ extern int _stricoll(char *a, char *b);
# include "main.pro"
# include "map.pro"
# include "mark.pro"
# include "match.pro"
# include "memfile.pro"
# include "memline.pro"
# ifdef FEAT_MENU

View File

@ -43,19 +43,4 @@ void set_context_in_highlight_cmd(expand_T *xp, char_u *arg);
char_u *get_highlight_name(expand_T *xp, int idx);
char_u *get_highlight_name_ext(expand_T *xp, int idx, int skip_cleared);
void free_highlight_fonts(void);
void clear_matches(win_T *wp);
void init_search_hl(win_T *wp, match_T *search_hl);
void prepare_search_hl(win_T *wp, match_T *search_hl, linenr_T lnum);
int prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **line, match_T *search_hl, int *search_attr);
int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match_T *search_hl, int *has_match_conc, int *match_conc, int did_line_attr, int lcs_eol_one);
int get_prevcol_hl_flag(win_T *wp, match_T *search_hl, long curcol);
void get_search_match_hl(win_T *wp, match_T *search_hl, long col, int *char_attr);
void f_clearmatches(typval_T *argvars, typval_T *rettv);
void f_getmatches(typval_T *argvars, typval_T *rettv);
void f_setmatches(typval_T *argvars, typval_T *rettv);
void f_matchadd(typval_T *argvars, typval_T *rettv);
void f_matchaddpos(typval_T *argvars, typval_T *rettv);
void f_matcharg(typval_T *argvars, typval_T *rettv);
void f_matchdelete(typval_T *argvars, typval_T *rettv);
void ex_match(exarg_T *eap);
/* vim: set ft=c : */

17
src/proto/match.pro Normal file
View File

@ -0,0 +1,17 @@
/* match.c */
void clear_matches(win_T *wp);
void init_search_hl(win_T *wp, match_T *search_hl);
void prepare_search_hl(win_T *wp, match_T *search_hl, linenr_T lnum);
int prepare_search_hl_line(win_T *wp, linenr_T lnum, colnr_T mincol, char_u **line, match_T *search_hl, int *search_attr);
int update_search_hl(win_T *wp, linenr_T lnum, colnr_T col, char_u **line, match_T *search_hl, int *has_match_conc, int *match_conc, int did_line_attr, int lcs_eol_one);
int get_prevcol_hl_flag(win_T *wp, match_T *search_hl, long curcol);
void get_search_match_hl(win_T *wp, match_T *search_hl, long col, int *char_attr);
void f_clearmatches(typval_T *argvars, typval_T *rettv);
void f_getmatches(typval_T *argvars, typval_T *rettv);
void f_setmatches(typval_T *argvars, typval_T *rettv);
void f_matchadd(typval_T *argvars, typval_T *rettv);
void f_matchaddpos(typval_T *argvars, typval_T *rettv);
void f_matcharg(typval_T *argvars, typval_T *rettv);
void f_matchdelete(typval_T *argvars, typval_T *rettv);
void ex_match(exarg_T *eap);
/* vim: set ft=c : */

View File

@ -754,6 +754,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1078,
/**/
1077,
/**/