|
Karsten Hopp |
c44dc5 |
To: vim_dev@googlegroups.com
|
|
Karsten Hopp |
c44dc5 |
Subject: Patch 7.3.1129
|
|
Karsten Hopp |
c44dc5 |
Fcc: outbox
|
|
Karsten Hopp |
c44dc5 |
From: Bram Moolenaar <Bram@moolenaar.net>
|
|
Karsten Hopp |
c44dc5 |
Mime-Version: 1.0
|
|
Karsten Hopp |
c44dc5 |
Content-Type: text/plain; charset=UTF-8
|
|
Karsten Hopp |
c44dc5 |
Content-Transfer-Encoding: 8bit
|
|
Karsten Hopp |
c44dc5 |
------------
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
Patch 7.3.1129
|
|
Karsten Hopp |
c44dc5 |
Problem: Can't see what pattern in syntax highlighting is slow.
|
|
Karsten Hopp |
c44dc5 |
Solution: Add the ":syntime" command.
|
|
Karsten Hopp |
c44dc5 |
Files: src/structs.h, src/syntax.c, src/ex_cmds.h, src/ex_docmd.c,
|
|
Karsten Hopp |
c44dc5 |
src/proto/syntax.pro, src/ex_cmds2.c, src/proto/ex_cmds2.pro,
|
|
Karsten Hopp |
c44dc5 |
runtime/doc/syntax.txt
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/structs.h 2013-05-19 19:16:25.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/structs.h 2013-06-06 12:24:08.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 1206,1211 ****
|
|
Karsten Hopp |
c44dc5 |
--- 1206,1223 ----
|
|
Karsten Hopp |
c44dc5 |
typedef struct qf_info_S qf_info_T;
|
|
Karsten Hopp |
c44dc5 |
#endif
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ /*
|
|
Karsten Hopp |
c44dc5 |
+ * Used for :syntime: timing of executing a syntax pattern.
|
|
Karsten Hopp |
c44dc5 |
+ */
|
|
Karsten Hopp |
c44dc5 |
+ typedef struct {
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T total; /* total time used */
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T slowest; /* time of slowest call */
|
|
Karsten Hopp |
c44dc5 |
+ long count; /* nr of times used */
|
|
Karsten Hopp |
c44dc5 |
+ long match; /* nr of times matched */
|
|
Karsten Hopp |
c44dc5 |
+ } syn_time_T;
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
/*
|
|
Karsten Hopp |
c44dc5 |
* These are items normally related to a buffer. But when using ":ownsyntax"
|
|
Karsten Hopp |
c44dc5 |
* a window may have its own instance.
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 1230,1235 ****
|
|
Karsten Hopp |
c44dc5 |
--- 1242,1250 ----
|
|
Karsten Hopp |
c44dc5 |
long b_syn_sync_linebreaks; /* offset for multi-line pattern */
|
|
Karsten Hopp |
c44dc5 |
char_u *b_syn_linecont_pat; /* line continuation pattern */
|
|
Karsten Hopp |
c44dc5 |
regprog_T *b_syn_linecont_prog; /* line continuation program */
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ syn_time_T b_syn_linecont_time;
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
int b_syn_linecont_ic; /* ignore-case flag for above */
|
|
Karsten Hopp |
c44dc5 |
int b_syn_topgrp; /* for ":syntax include" */
|
|
Karsten Hopp |
c44dc5 |
# ifdef FEAT_CONCEAL
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/syntax.c 2013-05-06 04:21:35.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/syntax.c 2013-06-06 12:37:55.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 153,158 ****
|
|
Karsten Hopp |
c44dc5 |
--- 153,161 ----
|
|
Karsten Hopp |
c44dc5 |
short sp_syn_match_id; /* highlight group ID of pattern */
|
|
Karsten Hopp |
c44dc5 |
char_u *sp_pattern; /* regexp to match, pattern */
|
|
Karsten Hopp |
c44dc5 |
regprog_T *sp_prog; /* regexp to match, program */
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ syn_time_T sp_time;
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
int sp_ic; /* ignore-case flag for sp_prog */
|
|
Karsten Hopp |
c44dc5 |
short sp_off_flags; /* see below */
|
|
Karsten Hopp |
c44dc5 |
int sp_offsets[SPO_COUNT]; /* offsets */
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 269,274 ****
|
|
Karsten Hopp |
c44dc5 |
--- 272,279 ----
|
|
Karsten Hopp |
c44dc5 |
*/
|
|
Karsten Hopp |
c44dc5 |
static int keepend_level = -1;
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
+ static char msg_no_items[] = N_("No Syntax items defined for this buffer");
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
/*
|
|
Karsten Hopp |
c44dc5 |
* For the current state we need to remember more than just the idx.
|
|
Karsten Hopp |
c44dc5 |
* When si_m_endpos.lnum is 0, the items other than si_idx are unknown.
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 395,400 ****
|
|
Karsten Hopp |
c44dc5 |
--- 400,420 ----
|
|
Karsten Hopp |
c44dc5 |
static int in_id_list __ARGS((stateitem_T *item, short *cont_list, struct sp_syn *ssp, int contained));
|
|
Karsten Hopp |
c44dc5 |
static int push_current_state __ARGS((int idx));
|
|
Karsten Hopp |
c44dc5 |
static void pop_current_state __ARGS((void));
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ static void syn_clear_time __ARGS((syn_time_T *tt));
|
|
Karsten Hopp |
c44dc5 |
+ static void syntime_clear __ARGS((void));
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef __BORLANDC__
|
|
Karsten Hopp |
c44dc5 |
+ static int _RTLENTRYF syn_compare_syntime __ARGS((const void *v1, const void *v2));
|
|
Karsten Hopp |
c44dc5 |
+ #else
|
|
Karsten Hopp |
c44dc5 |
+ static int syn_compare_syntime __ARGS((const void *v1, const void *v2));
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
+ static void syntime_report __ARGS((void));
|
|
Karsten Hopp |
c44dc5 |
+ static int syn_time_on = FALSE;
|
|
Karsten Hopp |
c44dc5 |
+ # define IF_SYN_TIME(p) (p)
|
|
Karsten Hopp |
c44dc5 |
+ #else
|
|
Karsten Hopp |
c44dc5 |
+ # define IF_SYN_TIME(p) NULL
|
|
Karsten Hopp |
c44dc5 |
+ typedef int syn_time_T;
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
static void syn_stack_apply_changes_block __ARGS((synblock_T *block, buf_T *buf));
|
|
Karsten Hopp |
c44dc5 |
static void find_endpos __ARGS((int idx, lpos_T *startpos, lpos_T *m_endpos, lpos_T *hl_endpos, long *flagsp, lpos_T *end_endpos, int *end_idx, reg_extmatch_T *start_ext));
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 406,412 ****
|
|
Karsten Hopp |
c44dc5 |
static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
|
|
Karsten Hopp |
c44dc5 |
static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
|
|
Karsten Hopp |
c44dc5 |
static char_u *syn_getcurline __ARGS((void));
|
|
Karsten Hopp |
c44dc5 |
! static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col));
|
|
Karsten Hopp |
c44dc5 |
static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si, int *ccharp));
|
|
Karsten Hopp |
c44dc5 |
static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
|
|
Karsten Hopp |
c44dc5 |
static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing));
|
|
Karsten Hopp |
c44dc5 |
--- 426,432 ----
|
|
Karsten Hopp |
c44dc5 |
static void syn_add_end_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
|
|
Karsten Hopp |
c44dc5 |
static void syn_add_start_off __ARGS((lpos_T *result, regmmatch_T *regmatch, synpat_T *spp, int idx, int extra));
|
|
Karsten Hopp |
c44dc5 |
static char_u *syn_getcurline __ARGS((void));
|
|
Karsten Hopp |
c44dc5 |
! static int syn_regexec __ARGS((regmmatch_T *rmp, linenr_T lnum, colnr_T col, syn_time_T *st));
|
|
Karsten Hopp |
c44dc5 |
static int check_keyword_id __ARGS((char_u *line, int startcol, int *endcol, long *flags, short **next_list, stateitem_T *cur_si, int *ccharp));
|
|
Karsten Hopp |
c44dc5 |
static void syn_cmd_case __ARGS((exarg_T *eap, int syncing));
|
|
Karsten Hopp |
c44dc5 |
static void syn_cmd_spell __ARGS((exarg_T *eap, int syncing));
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 977,983 ****
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = syn_block->b_syn_linecont_prog;
|
|
Karsten Hopp |
c44dc5 |
! return syn_regexec(®match, lnum, (colnr_T)0);
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
return FALSE;
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
--- 997,1004 ----
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = syn_block->b_syn_linecont_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = syn_block->b_syn_linecont_prog;
|
|
Karsten Hopp |
c44dc5 |
! return syn_regexec(®match, lnum, (colnr_T)0,
|
|
Karsten Hopp |
c44dc5 |
! IF_SYN_TIME(&syn_block->b_syn_linecont_time));
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
return FALSE;
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 2068,2075 ****
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = spp->sp_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = spp->sp_prog;
|
|
Karsten Hopp |
c44dc5 |
! if (!syn_regexec(®match, current_lnum,
|
|
Karsten Hopp |
c44dc5 |
! (colnr_T)lc_col))
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
/* no match in this line, try another one */
|
|
Karsten Hopp |
c44dc5 |
spp->sp_startcol = MAXCOL;
|
|
Karsten Hopp |
c44dc5 |
--- 2089,2098 ----
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = spp->sp_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = spp->sp_prog;
|
|
Karsten Hopp |
c44dc5 |
! if (!syn_regexec(®match,
|
|
Karsten Hopp |
c44dc5 |
! current_lnum,
|
|
Karsten Hopp |
c44dc5 |
! (colnr_T)lc_col,
|
|
Karsten Hopp |
c44dc5 |
! IF_SYN_TIME(&spp->sp_time)))
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
/* no match in this line, try another one */
|
|
Karsten Hopp |
c44dc5 |
spp->sp_startcol = MAXCOL;
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 2950,2956 ****
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = spp->sp_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = spp->sp_prog;
|
|
Karsten Hopp |
c44dc5 |
! if (syn_regexec(®match, startpos->lnum, lc_col))
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
if (best_idx == -1 || regmatch.startpos[0].col
|
|
Karsten Hopp |
c44dc5 |
< best_regmatch.startpos[0].col)
|
|
Karsten Hopp |
c44dc5 |
--- 2973,2980 ----
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = spp->sp_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = spp->sp_prog;
|
|
Karsten Hopp |
c44dc5 |
! if (syn_regexec(®match, startpos->lnum, lc_col,
|
|
Karsten Hopp |
c44dc5 |
! IF_SYN_TIME(&spp->sp_time)))
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
if (best_idx == -1 || regmatch.startpos[0].col
|
|
Karsten Hopp |
c44dc5 |
< best_regmatch.startpos[0].col)
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 2981,2987 ****
|
|
Karsten Hopp |
c44dc5 |
lc_col = 0;
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = spp_skip->sp_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = spp_skip->sp_prog;
|
|
Karsten Hopp |
c44dc5 |
! if (syn_regexec(®match, startpos->lnum, lc_col)
|
|
Karsten Hopp |
c44dc5 |
&& regmatch.startpos[0].col
|
|
Karsten Hopp |
c44dc5 |
<= best_regmatch.startpos[0].col)
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
--- 3005,3012 ----
|
|
Karsten Hopp |
c44dc5 |
lc_col = 0;
|
|
Karsten Hopp |
c44dc5 |
regmatch.rmm_ic = spp_skip->sp_ic;
|
|
Karsten Hopp |
c44dc5 |
regmatch.regprog = spp_skip->sp_prog;
|
|
Karsten Hopp |
c44dc5 |
! if (syn_regexec(®match, startpos->lnum, lc_col,
|
|
Karsten Hopp |
c44dc5 |
! IF_SYN_TIME(&spp_skip->sp_time))
|
|
Karsten Hopp |
c44dc5 |
&& regmatch.startpos[0].col
|
|
Karsten Hopp |
c44dc5 |
<= best_regmatch.startpos[0].col)
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 3229,3241 ****
|
|
Karsten Hopp |
c44dc5 |
* Returns TRUE when there is a match.
|
|
Karsten Hopp |
c44dc5 |
*/
|
|
Karsten Hopp |
c44dc5 |
static int
|
|
Karsten Hopp |
c44dc5 |
! syn_regexec(rmp, lnum, col)
|
|
Karsten Hopp |
c44dc5 |
regmmatch_T *rmp;
|
|
Karsten Hopp |
c44dc5 |
linenr_T lnum;
|
|
Karsten Hopp |
c44dc5 |
colnr_T col;
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
rmp->rmm_maxcol = syn_buf->b_p_smc;
|
|
Karsten Hopp |
c44dc5 |
! if (vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL) > 0)
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
rmp->startpos[0].lnum += lnum;
|
|
Karsten Hopp |
c44dc5 |
rmp->endpos[0].lnum += lnum;
|
|
Karsten Hopp |
c44dc5 |
--- 3254,3290 ----
|
|
Karsten Hopp |
c44dc5 |
* Returns TRUE when there is a match.
|
|
Karsten Hopp |
c44dc5 |
*/
|
|
Karsten Hopp |
c44dc5 |
static int
|
|
Karsten Hopp |
c44dc5 |
! syn_regexec(rmp, lnum, col, st)
|
|
Karsten Hopp |
c44dc5 |
regmmatch_T *rmp;
|
|
Karsten Hopp |
c44dc5 |
linenr_T lnum;
|
|
Karsten Hopp |
c44dc5 |
colnr_T col;
|
|
Karsten Hopp |
c44dc5 |
+ syn_time_T *st;
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
+ int r;
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T pt;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ if (syn_time_on)
|
|
Karsten Hopp |
c44dc5 |
+ profile_start(&pt;;
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
rmp->rmm_maxcol = syn_buf->b_p_smc;
|
|
Karsten Hopp |
c44dc5 |
! r = vim_regexec_multi(rmp, syn_win, syn_buf, lnum, col, NULL);
|
|
Karsten Hopp |
c44dc5 |
!
|
|
Karsten Hopp |
c44dc5 |
! #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
! if (syn_time_on)
|
|
Karsten Hopp |
c44dc5 |
! {
|
|
Karsten Hopp |
c44dc5 |
! profile_end(&pt;;
|
|
Karsten Hopp |
c44dc5 |
! profile_add(&st->total, &pt;;
|
|
Karsten Hopp |
c44dc5 |
! if (profile_cmp(&pt, &st->slowest) < 0)
|
|
Karsten Hopp |
c44dc5 |
! st->slowest = pt;
|
|
Karsten Hopp |
c44dc5 |
! ++st->count;
|
|
Karsten Hopp |
c44dc5 |
! if (r > 0)
|
|
Karsten Hopp |
c44dc5 |
! ++st->match;
|
|
Karsten Hopp |
c44dc5 |
! }
|
|
Karsten Hopp |
c44dc5 |
! #endif
|
|
Karsten Hopp |
c44dc5 |
!
|
|
Karsten Hopp |
c44dc5 |
! if (r > 0)
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
rmp->startpos[0].lnum += lnum;
|
|
Karsten Hopp |
c44dc5 |
rmp->endpos[0].lnum += lnum;
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 3769,3775 ****
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
if (!syntax_present(curwin))
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
! MSG(_("No Syntax items defined for this buffer"));
|
|
Karsten Hopp |
c44dc5 |
return;
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
--- 3818,3824 ----
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
if (!syntax_present(curwin))
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
! MSG(_(msg_no_items));
|
|
Karsten Hopp |
c44dc5 |
return;
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 5609,5614 ****
|
|
Karsten Hopp |
c44dc5 |
--- 5658,5666 ----
|
|
Karsten Hopp |
c44dc5 |
if (ci->sp_prog == NULL)
|
|
Karsten Hopp |
c44dc5 |
return NULL;
|
|
Karsten Hopp |
c44dc5 |
ci->sp_ic = curwin->w_s->b_syn_ic;
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ syn_clear_time(&ci->sp_time);
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
/*
|
|
Karsten Hopp |
c44dc5 |
* Check for a match, highlight or region offset.
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 5783,5790 ****
|
|
Karsten Hopp |
c44dc5 |
cpo_save = p_cpo;
|
|
Karsten Hopp |
c44dc5 |
p_cpo = (char_u *)"";
|
|
Karsten Hopp |
c44dc5 |
curwin->w_s->b_syn_linecont_prog =
|
|
Karsten Hopp |
c44dc5 |
! vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC);
|
|
Karsten Hopp |
c44dc5 |
p_cpo = cpo_save;
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
if (curwin->w_s->b_syn_linecont_prog == NULL)
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
--- 5835,5845 ----
|
|
Karsten Hopp |
c44dc5 |
cpo_save = p_cpo;
|
|
Karsten Hopp |
c44dc5 |
p_cpo = (char_u *)"";
|
|
Karsten Hopp |
c44dc5 |
curwin->w_s->b_syn_linecont_prog =
|
|
Karsten Hopp |
c44dc5 |
! vim_regcomp(curwin->w_s->b_syn_linecont_pat, RE_MAGIC);
|
|
Karsten Hopp |
c44dc5 |
p_cpo = cpo_save;
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ syn_clear_time(&curwin->w_s->b_syn_linecont_time);
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
if (curwin->w_s->b_syn_linecont_prog == NULL)
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 6471,6476 ****
|
|
Karsten Hopp |
c44dc5 |
--- 6526,6704 ----
|
|
Karsten Hopp |
c44dc5 |
}
|
|
Karsten Hopp |
c44dc5 |
#endif
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef FEAT_RELTIME
|
|
Karsten Hopp |
c44dc5 |
+ /*
|
|
Karsten Hopp |
c44dc5 |
+ * ":syntime".
|
|
Karsten Hopp |
c44dc5 |
+ */
|
|
Karsten Hopp |
c44dc5 |
+ void
|
|
Karsten Hopp |
c44dc5 |
+ ex_syntime(eap)
|
|
Karsten Hopp |
c44dc5 |
+ exarg_T *eap;
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ if (STRCMP(eap->arg, "on") == 0)
|
|
Karsten Hopp |
c44dc5 |
+ syn_time_on = TRUE;
|
|
Karsten Hopp |
c44dc5 |
+ else if (STRCMP(eap->arg, "off") == 0)
|
|
Karsten Hopp |
c44dc5 |
+ syn_time_on = FALSE;
|
|
Karsten Hopp |
c44dc5 |
+ else if (STRCMP(eap->arg, "clear") == 0)
|
|
Karsten Hopp |
c44dc5 |
+ syntime_clear();
|
|
Karsten Hopp |
c44dc5 |
+ else if (STRCMP(eap->arg, "report") == 0)
|
|
Karsten Hopp |
c44dc5 |
+ syntime_report();
|
|
Karsten Hopp |
c44dc5 |
+ else
|
|
Karsten Hopp |
c44dc5 |
+ EMSG2(_(e_invarg2), eap->arg);
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ static void
|
|
Karsten Hopp |
c44dc5 |
+ syn_clear_time(st)
|
|
Karsten Hopp |
c44dc5 |
+ syn_time_T *st;
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ profile_zero(&st->total);
|
|
Karsten Hopp |
c44dc5 |
+ profile_zero(&st->slowest);
|
|
Karsten Hopp |
c44dc5 |
+ st->count = 0;
|
|
Karsten Hopp |
c44dc5 |
+ st->match = 0;
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ /*
|
|
Karsten Hopp |
c44dc5 |
+ * Clear the syntax timing for the current buffer.
|
|
Karsten Hopp |
c44dc5 |
+ */
|
|
Karsten Hopp |
c44dc5 |
+ static void
|
|
Karsten Hopp |
c44dc5 |
+ syntime_clear()
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ int idx;
|
|
Karsten Hopp |
c44dc5 |
+ synpat_T *spp;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ if (!syntax_present(curwin))
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ MSG(_(msg_no_items));
|
|
Karsten Hopp |
c44dc5 |
+ return;
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ for (idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx)
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ spp = &(SYN_ITEMS(curwin->w_s)[idx]);
|
|
Karsten Hopp |
c44dc5 |
+ syn_clear_time(&spp->sp_time);
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ typedef struct
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T total;
|
|
Karsten Hopp |
c44dc5 |
+ int count;
|
|
Karsten Hopp |
c44dc5 |
+ int match;
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T slowest;
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T average;
|
|
Karsten Hopp |
c44dc5 |
+ int id;
|
|
Karsten Hopp |
c44dc5 |
+ char_u *pattern;
|
|
Karsten Hopp |
c44dc5 |
+ } time_entry_T;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ static int
|
|
Karsten Hopp |
c44dc5 |
+ #ifdef __BORLANDC__
|
|
Karsten Hopp |
c44dc5 |
+ _RTLENTRYF
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
+ syn_compare_syntime(v1, v2)
|
|
Karsten Hopp |
c44dc5 |
+ const void *v1;
|
|
Karsten Hopp |
c44dc5 |
+ const void *v2;
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ const time_entry_T *s1 = v1;
|
|
Karsten Hopp |
c44dc5 |
+ const time_entry_T *s2 = v2;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ return profile_cmp(&s1->total, &s2->total);
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ /*
|
|
Karsten Hopp |
c44dc5 |
+ * Clear the syntax timing for the current buffer.
|
|
Karsten Hopp |
c44dc5 |
+ */
|
|
Karsten Hopp |
c44dc5 |
+ static void
|
|
Karsten Hopp |
c44dc5 |
+ syntime_report()
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ int idx;
|
|
Karsten Hopp |
c44dc5 |
+ synpat_T *spp;
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T tm;
|
|
Karsten Hopp |
c44dc5 |
+ int len;
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T total_total;
|
|
Karsten Hopp |
c44dc5 |
+ int total_count = 0;
|
|
Karsten Hopp |
c44dc5 |
+ garray_T ga;
|
|
Karsten Hopp |
c44dc5 |
+ time_entry_T *p;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ if (!syntax_present(curwin))
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ MSG(_(msg_no_items));
|
|
Karsten Hopp |
c44dc5 |
+ return;
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ ga_init2(&ga, sizeof(time_entry_T), 50);
|
|
Karsten Hopp |
c44dc5 |
+ profile_zero(&total_total);
|
|
Karsten Hopp |
c44dc5 |
+ for (idx = 0; idx < curwin->w_s->b_syn_patterns.ga_len; ++idx)
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ spp = &(SYN_ITEMS(curwin->w_s)[idx]);
|
|
Karsten Hopp |
c44dc5 |
+ if (spp->sp_time.count > 0)
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ ga_grow(&ga, 1);
|
|
Karsten Hopp |
c44dc5 |
+ p = ((time_entry_T *)ga.ga_data) + ga.ga_len;
|
|
Karsten Hopp |
c44dc5 |
+ p->total = spp->sp_time.total;
|
|
Karsten Hopp |
c44dc5 |
+ profile_add(&total_total, &spp->sp_time.total);
|
|
Karsten Hopp |
c44dc5 |
+ p->count = spp->sp_time.count;
|
|
Karsten Hopp |
c44dc5 |
+ p->match = spp->sp_time.match;
|
|
Karsten Hopp |
c44dc5 |
+ total_count += spp->sp_time.count;
|
|
Karsten Hopp |
c44dc5 |
+ p->slowest = spp->sp_time.slowest;
|
|
Karsten Hopp |
c44dc5 |
+ # ifdef FEAT_FLOAT
|
|
Karsten Hopp |
c44dc5 |
+ profile_divide(&spp->sp_time.total, spp->sp_time.count, &tm;;
|
|
Karsten Hopp |
c44dc5 |
+ p->average = tm;
|
|
Karsten Hopp |
c44dc5 |
+ # endif
|
|
Karsten Hopp |
c44dc5 |
+ p->id = spp->sp_syn.id;
|
|
Karsten Hopp |
c44dc5 |
+ p->pattern = spp->sp_pattern;
|
|
Karsten Hopp |
c44dc5 |
+ ++ga.ga_len;
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ /* sort on total time */
|
|
Karsten Hopp |
c44dc5 |
+ qsort(ga.ga_data, (size_t)ga.ga_len, sizeof(time_entry_T), syn_compare_syntime);
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS_TITLE(_(" TOTAL COUNT MATCH SLOWEST AVERAGE NAME PATTERN"));
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS("\n");
|
|
Karsten Hopp |
c44dc5 |
+ for (idx = 0; idx < ga.ga_len && !got_int; ++idx)
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ spp = &(SYN_ITEMS(curwin->w_s)[idx]);
|
|
Karsten Hopp |
c44dc5 |
+ p = ((time_entry_T *)ga.ga_data) + idx;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(profile_msg(&p->total));
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(" "); /* make sure there is always a separating space */
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(13);
|
|
Karsten Hopp |
c44dc5 |
+ msg_outnum(p->count);
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(" ");
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(20);
|
|
Karsten Hopp |
c44dc5 |
+ msg_outnum(p->match);
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(" ");
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(26);
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(profile_msg(&p->slowest));
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(" ");
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(38);
|
|
Karsten Hopp |
c44dc5 |
+ # ifdef FEAT_FLOAT
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(profile_msg(&p->average));
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(" ");
|
|
Karsten Hopp |
c44dc5 |
+ # endif
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(50);
|
|
Karsten Hopp |
c44dc5 |
+ msg_outtrans(HL_TABLE()[p->id - 1].sg_name);
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(" ");
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(69);
|
|
Karsten Hopp |
c44dc5 |
+ if (Columns < 80)
|
|
Karsten Hopp |
c44dc5 |
+ len = 20; /* will wrap anyway */
|
|
Karsten Hopp |
c44dc5 |
+ else
|
|
Karsten Hopp |
c44dc5 |
+ len = Columns - 70;
|
|
Karsten Hopp |
c44dc5 |
+ if (len > (int)STRLEN(p->pattern))
|
|
Karsten Hopp |
c44dc5 |
+ len = (int)STRLEN(p->pattern);
|
|
Karsten Hopp |
c44dc5 |
+ msg_outtrans_len(p->pattern, len);
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS("\n");
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ if (!got_int)
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS("\n");
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS(profile_msg(&total_total));
|
|
Karsten Hopp |
c44dc5 |
+ msg_advance(13);
|
|
Karsten Hopp |
c44dc5 |
+ msg_outnum(total_count);
|
|
Karsten Hopp |
c44dc5 |
+ MSG_PUTS("\n");
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
#endif /* FEAT_SYN_HL */
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
/**************************************
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/ex_cmds.h 2013-05-17 16:39:59.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/ex_cmds.h 2013-06-05 22:20:35.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 925,930 ****
|
|
Karsten Hopp |
c44dc5 |
--- 925,932 ----
|
|
Karsten Hopp |
c44dc5 |
TRLBAR|CMDWIN),
|
|
Karsten Hopp |
c44dc5 |
EX(CMD_syntax, "syntax", ex_syntax,
|
|
Karsten Hopp |
c44dc5 |
EXTRA|NOTRLCOM|CMDWIN),
|
|
Karsten Hopp |
c44dc5 |
+ EX(CMD_syntime, "syntime", ex_syntime,
|
|
Karsten Hopp |
c44dc5 |
+ WORD1|TRLBAR|CMDWIN),
|
|
Karsten Hopp |
c44dc5 |
EX(CMD_syncbind, "syncbind", ex_syncbind,
|
|
Karsten Hopp |
c44dc5 |
TRLBAR),
|
|
Karsten Hopp |
c44dc5 |
EX(CMD_t, "t", ex_copymove,
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/ex_docmd.c 2013-06-02 19:22:05.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/ex_docmd.c 2013-06-05 22:21:30.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 242,247 ****
|
|
Karsten Hopp |
c44dc5 |
--- 242,250 ----
|
|
Karsten Hopp |
c44dc5 |
# define ex_syntax ex_ni
|
|
Karsten Hopp |
c44dc5 |
# define ex_ownsyntax ex_ni
|
|
Karsten Hopp |
c44dc5 |
#endif
|
|
Karsten Hopp |
c44dc5 |
+ #if !defined(FEAT_SYN_HL) || !defined(FEAT_RELTIME)
|
|
Karsten Hopp |
c44dc5 |
+ # define ex_syntime ex_ni
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
#ifndef FEAT_SPELL
|
|
Karsten Hopp |
c44dc5 |
# define ex_spell ex_ni
|
|
Karsten Hopp |
c44dc5 |
# define ex_mkspell ex_ni
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/proto/syntax.pro 2010-08-15 21:57:28.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/proto/syntax.pro 2013-06-05 22:59:09.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 19,24 ****
|
|
Karsten Hopp |
c44dc5 |
--- 19,25 ----
|
|
Karsten Hopp |
c44dc5 |
int syn_get_sub_char __ARGS((void));
|
|
Karsten Hopp |
c44dc5 |
int syn_get_stack_item __ARGS((int i));
|
|
Karsten Hopp |
c44dc5 |
int syn_get_foldlevel __ARGS((win_T *wp, long lnum));
|
|
Karsten Hopp |
c44dc5 |
+ void ex_syntime __ARGS((exarg_T *eap));
|
|
Karsten Hopp |
c44dc5 |
void init_highlight __ARGS((int both, int reset));
|
|
Karsten Hopp |
c44dc5 |
int load_colors __ARGS((char_u *name));
|
|
Karsten Hopp |
c44dc5 |
void do_highlight __ARGS((char_u *line, int forceit, int init));
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/ex_cmds2.c 2013-05-06 04:50:26.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/ex_cmds2.c 2013-06-06 12:14:52.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 958,963 ****
|
|
Karsten Hopp |
c44dc5 |
--- 958,993 ----
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
# endif /* FEAT_PROFILE || FEAT_RELTIME */
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
+ #if defined(FEAT_SYN_HL) && defined(FEAT_RELTIME) && defined(FEAT_FLOAT)
|
|
Karsten Hopp |
c44dc5 |
+ # if defined(HAVE_MATH_H)
|
|
Karsten Hopp |
c44dc5 |
+ # include <math.h>
|
|
Karsten Hopp |
c44dc5 |
+ # endif
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ /*
|
|
Karsten Hopp |
c44dc5 |
+ * Divide the time "tm" by "count" and store in "tm2".
|
|
Karsten Hopp |
c44dc5 |
+ */
|
|
Karsten Hopp |
c44dc5 |
+ void
|
|
Karsten Hopp |
c44dc5 |
+ profile_divide(tm, count, tm2)
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T *tm;
|
|
Karsten Hopp |
c44dc5 |
+ proftime_T *tm2;
|
|
Karsten Hopp |
c44dc5 |
+ int count;
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ if (count == 0)
|
|
Karsten Hopp |
c44dc5 |
+ profile_zero(tm2);
|
|
Karsten Hopp |
c44dc5 |
+ else
|
|
Karsten Hopp |
c44dc5 |
+ {
|
|
Karsten Hopp |
c44dc5 |
+ # ifdef WIN3264
|
|
Karsten Hopp |
c44dc5 |
+ tm2->QuadPart = tm->QuadPart / count;
|
|
Karsten Hopp |
c44dc5 |
+ # else
|
|
Karsten Hopp |
c44dc5 |
+ double usec = (tm->tv_sec * 1000000.0 + tm->tv_usec) / count;
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ tm2->tv_sec = floor(usec / 1000000.0);
|
|
Karsten Hopp |
c44dc5 |
+ tm2->tv_usec = round(usec - (tm2->tv_sec * 1000000.0));
|
|
Karsten Hopp |
c44dc5 |
+ # endif
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ }
|
|
Karsten Hopp |
c44dc5 |
+ #endif
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
# if defined(FEAT_PROFILE) || defined(PROTO)
|
|
Karsten Hopp |
c44dc5 |
/*
|
|
Karsten Hopp |
c44dc5 |
* Functions for profiling.
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 1050,1056 ****
|
|
Karsten Hopp |
c44dc5 |
*/
|
|
Karsten Hopp |
c44dc5 |
int
|
|
Karsten Hopp |
c44dc5 |
profile_cmp(tm1, tm2)
|
|
Karsten Hopp |
c44dc5 |
! proftime_T *tm1, *tm2;
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
# ifdef WIN3264
|
|
Karsten Hopp |
c44dc5 |
return (int)(tm2->QuadPart - tm1->QuadPart);
|
|
Karsten Hopp |
c44dc5 |
--- 1080,1086 ----
|
|
Karsten Hopp |
c44dc5 |
*/
|
|
Karsten Hopp |
c44dc5 |
int
|
|
Karsten Hopp |
c44dc5 |
profile_cmp(tm1, tm2)
|
|
Karsten Hopp |
c44dc5 |
! const proftime_T *tm1, *tm2;
|
|
Karsten Hopp |
c44dc5 |
{
|
|
Karsten Hopp |
c44dc5 |
# ifdef WIN3264
|
|
Karsten Hopp |
c44dc5 |
return (int)(tm2->QuadPart - tm1->QuadPart);
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/proto/ex_cmds2.pro 2012-06-29 12:57:03.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/proto/ex_cmds2.pro 2013-06-06 12:14:57.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 17,28 ****
|
|
Karsten Hopp |
c44dc5 |
void profile_setlimit __ARGS((long msec, proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
int profile_passed_limit __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
void profile_zero __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
void profile_add __ARGS((proftime_T *tm, proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children));
|
|
Karsten Hopp |
c44dc5 |
void profile_get_wait __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma));
|
|
Karsten Hopp |
c44dc5 |
int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
! int profile_cmp __ARGS((proftime_T *tm1, proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
void ex_profile __ARGS((exarg_T *eap));
|
|
Karsten Hopp |
c44dc5 |
char_u *get_profile_name __ARGS((expand_T *xp, int idx));
|
|
Karsten Hopp |
c44dc5 |
void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg));
|
|
Karsten Hopp |
c44dc5 |
--- 17,29 ----
|
|
Karsten Hopp |
c44dc5 |
void profile_setlimit __ARGS((long msec, proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
int profile_passed_limit __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
void profile_zero __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
+ void profile_divide __ARGS((proftime_T *tm, int count, proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
void profile_add __ARGS((proftime_T *tm, proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
void profile_self __ARGS((proftime_T *self, proftime_T *total, proftime_T *children));
|
|
Karsten Hopp |
c44dc5 |
void profile_get_wait __ARGS((proftime_T *tm));
|
|
Karsten Hopp |
c44dc5 |
void profile_sub_wait __ARGS((proftime_T *tm, proftime_T *tma));
|
|
Karsten Hopp |
c44dc5 |
int profile_equal __ARGS((proftime_T *tm1, proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
! int profile_cmp __ARGS((const proftime_T *tm1, const proftime_T *tm2));
|
|
Karsten Hopp |
c44dc5 |
void ex_profile __ARGS((exarg_T *eap));
|
|
Karsten Hopp |
c44dc5 |
char_u *get_profile_name __ARGS((expand_T *xp, int idx));
|
|
Karsten Hopp |
c44dc5 |
void set_context_in_profile_cmd __ARGS((expand_T *xp, char_u *arg));
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/runtime/doc/syntax.txt 2010-08-15 21:57:12.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- runtime/doc/syntax.txt 2013-06-06 13:00:36.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 37,42 ****
|
|
Karsten Hopp |
c44dc5 |
--- 37,43 ----
|
|
Karsten Hopp |
c44dc5 |
15. Highlighting tags |tag-highlight|
|
|
Karsten Hopp |
c44dc5 |
16. Window-local syntax |:ownsyntax|
|
|
Karsten Hopp |
c44dc5 |
17. Color xterms |xterm-color|
|
|
Karsten Hopp |
c44dc5 |
+ 18. When syntax is slow |:syntime|
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
{Vi does not have any of these commands}
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 4754,4757 ****
|
|
Karsten Hopp |
c44dc5 |
--- 5087,5146 ----
|
|
Karsten Hopp |
c44dc5 |
that Setup / Font / Enable Bold is NOT enabled.
|
|
Karsten Hopp |
c44dc5 |
(info provided by John Love-Jensen <eljay@Adobe.COM>)
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ ==============================================================================
|
|
Karsten Hopp |
c44dc5 |
+ 18. When syntax is slow *:syntime*
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ This is aimed at authors of a syntax file.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ If your syntax causes redrawing to be slow, here are a few hints on making it
|
|
Karsten Hopp |
c44dc5 |
+ faster. To see slowness switch on some features that usually interfere, such
|
|
Karsten Hopp |
c44dc5 |
+ as 'relativenumber' and |folding|.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ To find out what patterns are consuming most time, get an overview with this
|
|
Karsten Hopp |
c44dc5 |
+ sequence: >
|
|
Karsten Hopp |
c44dc5 |
+ :syntime on
|
|
Karsten Hopp |
c44dc5 |
+ [ redraw the text at least once with CTRL-L ]
|
|
Karsten Hopp |
c44dc5 |
+ :syntime report
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ This will display a list of syntax patterns that were used, sorted by the time
|
|
Karsten Hopp |
c44dc5 |
+ it took to match them against the text.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ :syntime on Start measuring syntax times. This will add some
|
|
Karsten Hopp |
c44dc5 |
+ overhead to compute the time spent on syntax pattern
|
|
Karsten Hopp |
c44dc5 |
+ matching.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ :syntime off Stop measuring syntax times.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ :syntime clear Set all the counters to zero, restart measuring.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ :syntime report Show the syntax items used since ":syntime on" in the
|
|
Karsten Hopp |
c44dc5 |
+ current window. Use a wider display to see more of
|
|
Karsten Hopp |
c44dc5 |
+ the output.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ The list is sorted by total time. The columns are:
|
|
Karsten Hopp |
c44dc5 |
+ TOTAL Total time in seconds spent on
|
|
Karsten Hopp |
c44dc5 |
+ matching this pattern.
|
|
Karsten Hopp |
c44dc5 |
+ COUNT Number of times the pattern was used.
|
|
Karsten Hopp |
c44dc5 |
+ MATCH Number of times the pattern actually
|
|
Karsten Hopp |
c44dc5 |
+ matched
|
|
Karsten Hopp |
c44dc5 |
+ SLOWEST The longest time for one try.
|
|
Karsten Hopp |
c44dc5 |
+ AVERAGE The average time for one try.
|
|
Karsten Hopp |
c44dc5 |
+ NAME Name of the syntax item. Note that
|
|
Karsten Hopp |
c44dc5 |
+ this is not unique.
|
|
Karsten Hopp |
c44dc5 |
+ PATTERN The pattern being used.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ Pattern matching gets slow when it has to try many alternatives. Try to
|
|
Karsten Hopp |
c44dc5 |
+ include as much literal text as possible to reduce the number of ways a
|
|
Karsten Hopp |
c44dc5 |
+ pattern does NOT match.
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ When using the "\@<=" and "\@
|
|
Karsten Hopp |
c44dc5 |
+ all positions in the current and previous line. For example, if the item is
|
|
Karsten Hopp |
c44dc5 |
+ literal text specify the size of that text (in bytes):
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+ "<\@<=span" Matches "span" in "
|
|
Karsten Hopp |
c44dc5 |
+ many places.
|
|
Karsten Hopp |
c44dc5 |
+ "<\@1<=span" Matches the same, but only tries one byte before "span".
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
+
|
|
Karsten Hopp |
c44dc5 |
vim:tw=78:sw=4:ts=8:ft=help:norl:
|
|
Karsten Hopp |
c44dc5 |
*** ../vim-7.3.1128/src/version.c 2013-06-05 21:42:49.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
--- src/version.c 2013-06-06 13:04:25.000000000 +0200
|
|
Karsten Hopp |
c44dc5 |
***************
|
|
Karsten Hopp |
c44dc5 |
*** 730,731 ****
|
|
Karsten Hopp |
c44dc5 |
--- 730,733 ----
|
|
Karsten Hopp |
c44dc5 |
{ /* Add new patch number below this line */
|
|
Karsten Hopp |
c44dc5 |
+ /**/
|
|
Karsten Hopp |
c44dc5 |
+ 1129,
|
|
Karsten Hopp |
c44dc5 |
/**/
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
--
|
|
Karsten Hopp |
c44dc5 |
From "know your smileys":
|
|
Karsten Hopp |
c44dc5 |
:'-D Laughing so much that they're crying
|
|
Karsten Hopp |
c44dc5 |
|
|
Karsten Hopp |
c44dc5 |
/// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\
|
|
Karsten Hopp |
c44dc5 |
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
|
|
Karsten Hopp |
c44dc5 |
\\\ an exciting new programming language -- http://www.Zimbu.org ///
|
|
Karsten Hopp |
c44dc5 |
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
|