diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/digraph.c | 2 | ||||
-rw-r--r-- | src/edit.c | 31 | ||||
-rw-r--r-- | src/globals.h | 1 | ||||
-rw-r--r-- | src/normal.c | 33 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/proto/normal.pro | 2 | ||||
-rw-r--r-- | src/search.c | 3 | ||||
-rw-r--r-- | src/spell.c | 2 | ||||
-rw-r--r-- | src/structs.h | 2 | ||||
-rw-r--r-- | src/syntax.c | 4 | ||||
-rw-r--r-- | src/version.h | 4 |
11 files changed, 58 insertions, 28 deletions
diff --git a/src/digraph.c b/src/digraph.c index 2f1bcda82d..892a3ed627 100644 --- a/src/digraph.c +++ b/src/digraph.c @@ -336,6 +336,7 @@ static digr_T digraphdefault[] = {'A', 'E', 158}, /* Æ */ {'o', 'x', 159}, /* ¤ - currency symbol in ISO 8859-1 */ {'e', '=', 159}, /* ¤ - euro symbol in ISO 8859-15 */ + {'E', 'u', 159}, /* ¤ - euro symbol in ISO 8859-15 */ {'j', 'u', 160}, /* µ */ {'y', '"', 167}, /* x XX */ {'~', '!', 170}, /* ¡ */ @@ -1423,6 +1424,7 @@ static digr_T digraphdefault[] = {'P', 't', 0x20a7}, {'W', '=', 0x20a9}, {'=', 'e', 0x20ac}, /* euro */ + {'E', 'u', 0x20ac}, /* euro */ {'o', 'C', 0x2103}, {'c', 'o', 0x2105}, {'o', 'F', 0x2109}, diff --git a/src/edit.c b/src/edit.c index d1a48dec92..5b72461356 100644 --- a/src/edit.c +++ b/src/edit.c @@ -31,7 +31,7 @@ #define CTRL_X_THESAURUS (10 + CTRL_X_WANT_IDENT) #define CTRL_X_CMDLINE 11 #define CTRL_X_FUNCTION 12 -#define CTRL_X_OCCULT 13 +#define CTRL_X_OMNI 13 #define CTRL_X_SPELL 14 #define CTRL_X_LOCAL_MSG 15 /* only used in "ctrl_x_msgs" */ @@ -52,7 +52,7 @@ static char *ctrl_x_msgs[] = N_(" Thesaurus completion (^T^N^P)"), N_(" Command-line completion (^V^N^P)"), N_(" User defined completion (^U^N^P)"), - N_(" Occult completion (^O^N^P)"), + N_(" Omni completion (^O^N^P)"), N_(" Spelling suggestion (^S^N^P)"), N_(" Keyword Local completion (^N^P)"), }; @@ -820,7 +820,7 @@ doESCkey: case Ctrl_O: /* execute one command */ #ifdef FEAT_COMPL_FUNC - if (ctrl_x_mode == CTRL_X_OCCULT) + if (ctrl_x_mode == CTRL_X_OMNI) goto docomplete; #endif if (echeck_abbr(Ctrl_O + ABBR_OFF)) @@ -1844,7 +1844,7 @@ vim_is_ctrl_x_key(c) #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: return (c == Ctrl_U || c == Ctrl_P || c == Ctrl_N); - case CTRL_X_OCCULT: + case CTRL_X_OMNI: return (c == Ctrl_O || c == Ctrl_P || c == Ctrl_N); #endif case CTRL_X_SPELL: @@ -2361,7 +2361,7 @@ ins_compl_prep(c) ctrl_x_mode = CTRL_X_FUNCTION; break; case Ctrl_O: - ctrl_x_mode = CTRL_X_OCCULT; + ctrl_x_mode = CTRL_X_OMNI; break; #endif case 's': @@ -2584,13 +2584,13 @@ ins_compl_next_buf(buf, flag) static int expand_by_function __ARGS((int type, char_u *base, char_u ***matches)); /* - * Execute user defined complete function 'completefunc' or 'occultfunc', and + * Execute user defined complete function 'completefunc' or 'omnifunc', and * get matches in "matches". * Return value is number of matches. */ static int expand_by_function(type, base, matches) - int type; /* CTRL_X_OCCULT or CTRL_X_FUNCTION */ + int type; /* CTRL_X_OMNI or CTRL_X_FUNCTION */ char_u *base; char_u ***matches; { @@ -2848,8 +2848,11 @@ ins_compl_get_exp(ini, dir) #ifdef FEAT_COMPL_FUNC case CTRL_X_FUNCTION: - case CTRL_X_OCCULT: - num_matches = expand_by_function(type, compl_pattern, &matches); + case CTRL_X_OMNI: + if (*compl_pattern == NUL) + num_matches = 0; + else + num_matches = expand_by_function(type, compl_pattern, &matches); if (num_matches > 0) ins_compl_add_matches(num_matches, matches, dir); break; @@ -3457,7 +3460,7 @@ ins_complete(c) compl_col = startcol; compl_length = curs_col - startcol; } - else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OCCULT) + else if (ctrl_x_mode == CTRL_X_FUNCTION || ctrl_x_mode == CTRL_X_OMNI) { #ifdef FEAT_COMPL_FUNC /* @@ -3469,12 +3472,16 @@ ins_complete(c) char_u *funcname; pos_T pos; - /* Call 'completefunc' or 'occultfunc' and get pattern length as a + /* Call 'completefunc' or 'omnifunc' and get pattern length as a * string */ funcname = ctrl_x_mode == CTRL_X_FUNCTION ? curbuf->b_p_cfu : curbuf->b_p_ofu; if (*funcname == NUL) + { + EMSG2(_(e_notset), ctrl_x_mode == CTRL_X_FUNCTION + ? "completefunc" : "omnifunc"); return FAIL; + } args[0] = (char_u *)"1"; args[1] = NULL; @@ -3483,7 +3490,7 @@ ins_complete(c) curwin->w_cursor = pos; /* restore the cursor position */ if (col < 0) - return FAIL; + col = curs_col; compl_col = col; if ((colnr_T)compl_col > curs_col) compl_col = curs_col; diff --git a/src/globals.h b/src/globals.h index 80d099bdd5..573dc98422 100644 --- a/src/globals.h +++ b/src/globals.h @@ -1418,6 +1418,7 @@ EXTERN char_u e_emptybuf[] INIT(= N_("E749: empty buffer")); EXTERN char_u e_invalpat[] INIT(= N_("E682: Invalid search pattern or delimiter")); #endif EXTERN char_u e_bufloaded[] INIT(= N_("E139: File is loaded in another buffer")); +EXTERN char_u e_notset[] INIT(= N_("E764: Option '%s' is not set")); #ifdef MACOS_X_UNIX EXTERN short disallow_gui INIT(= FALSE); diff --git a/src/normal.c b/src/normal.c index b184fd7834..12d4ffc8f6 100644 --- a/src/normal.c +++ b/src/normal.c @@ -60,7 +60,7 @@ static void nv_error __ARGS((cmdarg_T *cap)); static void nv_help __ARGS((cmdarg_T *cap)); static void nv_addsub __ARGS((cmdarg_T *cap)); static void nv_page __ARGS((cmdarg_T *cap)); -static void nv_gd __ARGS((oparg_T *oap, int nchar)); +static void nv_gd __ARGS((oparg_T *oap, int nchar, int thisblock)); static int nv_screengo __ARGS((oparg_T *oap, int dir, long dist)); #ifdef FEAT_MOUSE static void nv_mousescroll __ARGS((cmdarg_T *cap)); @@ -3920,15 +3920,16 @@ nv_page(cap) * Implementation of "gd" and "gD" command. */ static void -nv_gd(oap, nchar) +nv_gd(oap, nchar, thisblock) oparg_T *oap; int nchar; + int thisblock; /* 1 for "1gd" and "1gD" */ { int len; char_u *ptr; if ((len = find_ident_under_cursor(&ptr, FIND_IDENT)) == 0 - || find_decl(ptr, len, nchar == 'd', 0) == FAIL) + || find_decl(ptr, len, nchar == 'd', thisblock, 0) == FAIL) clearopbeep(oap); #ifdef FEAT_FOLDING else if ((fdo_flags & FDO_SEARCH) && KeyTyped && oap->op_type == OP_NOP) @@ -3937,15 +3938,18 @@ nv_gd(oap, nchar) } /* - * Search for variable declaration of "ptr[len]". When "locally" is TRUE in - * the current function ("gd"), otherwise in the current file ("gD"). + * Search for variable declaration of "ptr[len]". + * When "locally" is TRUE in the current function ("gd"), otherwise in the + * current file ("gD"). + * When "thisblock" is TRUE check the {} block scope. * Return FAIL when not found. */ int -find_decl(ptr, len, locally, searchflags) +find_decl(ptr, len, locally, thisblock, searchflags) char_u *ptr; int len; int locally; + int thisblock; int searchflags; /* flags passed to searchit() */ { char_u *pat; @@ -3983,11 +3987,11 @@ find_decl(ptr, len, locally, searchflags) } else { - par_pos = curwin->w_cursor; while (curwin->w_cursor.lnum > 1 && *skipwhite(ml_get_curline()) != NUL) --curwin->w_cursor.lnum; } curwin->w_cursor.col = 0; + par_pos = curwin->w_cursor; /* Search forward for the identifier, ignore comment lines. */ found_pos.lnum = 0; @@ -3997,6 +4001,19 @@ find_decl(ptr, len, locally, searchflags) pat, 1L, searchflags, RE_LAST); if (curwin->w_cursor.lnum >= old_pos.lnum) t = FAIL; /* match after start is failure too */ + + if (thisblock) + { + pos_T *pos; + + /* Check that the block the match is in doesn't end before the + * position where we started the search from. */ + if ((pos = findmatchlimit(NULL, '}', FM_FORWARD, + (int)(old_pos.lnum - curwin->w_cursor.lnum + 1))) != NULL + && pos->lnum < old_pos.lnum) + continue; + } + if (t == FAIL) { /* If we previously found a valid position, use it. */ @@ -7668,7 +7685,7 @@ nv_g_cmd(cap) */ case 'd': case 'D': - nv_gd(oap, cap->nchar); + nv_gd(oap, cap->nchar, (int)cap->count0); break; #ifdef FEAT_MOUSE diff --git a/src/option.c b/src/option.c index 2c71c36274..96d9df2daf 100644 --- a/src/option.c +++ b/src/option.c @@ -1603,7 +1603,7 @@ static struct vimoption (char_u *)NULL, PV_NONE, #endif {(char_u *)8L, (char_u *)4L}}, - {"occultfunc", "ofu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE, + {"omnifunc", "ofu", P_STRING|P_ALLOCED|P_VI_DEF|P_SECURE, #ifdef FEAT_COMPL_FUNC (char_u *)&p_ofu, PV_OFU, {(char_u *)"", (char_u *)0L} diff --git a/src/proto/normal.pro b/src/proto/normal.pro index 950f1e025f..8fd411a72a 100644 --- a/src/proto/normal.pro +++ b/src/proto/normal.pro @@ -16,7 +16,7 @@ void push_showcmd __ARGS((void)); void pop_showcmd __ARGS((void)); void do_check_scrollbind __ARGS((int check)); void check_scrollbind __ARGS((linenr_T topline_diff, long leftcol_diff)); -int find_decl __ARGS((char_u *ptr, int len, int locally, int searchflags)); +int find_decl __ARGS((char_u *ptr, int len, int locally, int thisblock, int searchflags)); void scroll_redraw __ARGS((int up, long count)); void do_nv_ident __ARGS((int c1, int c2)); int get_visual_text __ARGS((cmdarg_T *cap, char_u **pp, int *lenp)); diff --git a/src/search.c b/src/search.c index 0b7cb9420d..21daaa3379 100644 --- a/src/search.c +++ b/src/search.c @@ -1562,6 +1562,9 @@ check_prevcol(linep, col, ch, prevcol) * FM_FORWARD search forwards (when initc is '/', '*' or '#') * FM_BLOCKSTOP stop at start/end of block ({ or } in column 0) * FM_SKIPCOMM skip comments (not implemented yet!) + * + * "oap" is only used to set oap->motion_type for a linewise motion, it be + * NULL */ pos_T * diff --git a/src/spell.c b/src/spell.c index c3c54b767f..8f8c8929ce 100644 --- a/src/spell.c +++ b/src/spell.c @@ -7699,7 +7699,7 @@ spell_add_word(word, len, bad, index) if (*curbuf->b_p_spf == NUL) { - EMSG(_("E764: 'spellfile' is not set")); + EMSG2(_(e_notset), "spellfile"); return; } diff --git a/src/structs.h b/src/structs.h index 88fcf487ce..94b9ddbeb3 100644 --- a/src/structs.h +++ b/src/structs.h @@ -1288,7 +1288,7 @@ struct file_buffer #endif #ifdef FEAT_COMPL_FUNC char_u *b_p_cfu; /* 'completefunc' */ - char_u *b_p_ofu; /* 'occultfunc' */ + char_u *b_p_ofu; /* 'omnifunc' */ #endif int b_p_eol; /* 'endofline' */ int b_p_et; /* 'expandtab' */ diff --git a/src/syntax.c b/src/syntax.c index 65a7926115..116b724edb 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -6087,7 +6087,7 @@ static char *(highlight_init_light[]) = "Folded term=standout ctermbg=Grey ctermfg=DarkBlue guibg=LightGrey guifg=DarkBlue", "FoldColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue", "SignColumn term=standout ctermbg=Grey ctermfg=DarkBlue guibg=Grey guifg=DarkBlue", - "Visual term=reverse ctermbg=LightGrey guibg=LightGrey", + "Visual term=reverse ctermbg=Magenta guibg=LightGrey", "DiffAdd term=bold ctermbg=LightBlue guibg=LightBlue", "DiffChange term=bold ctermbg=LightMagenta guibg=LightMagenta", "DiffDelete term=bold ctermfg=Blue ctermbg=LightCyan gui=bold guifg=Blue guibg=LightCyan", @@ -6113,7 +6113,7 @@ static char *(highlight_init_dark[]) = "Folded term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=DarkGrey guifg=Cyan", "FoldColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan", "SignColumn term=standout ctermbg=DarkGrey ctermfg=Cyan guibg=Grey guifg=Cyan", - "Visual term=reverse ctermbg=DarkGrey guibg=DarkGrey", + "Visual term=reverse ctermbg=Magenta guibg=DarkGrey", "DiffAdd term=bold ctermbg=DarkBlue guibg=DarkBlue", "DiffChange term=bold ctermbg=DarkMagenta guibg=DarkMagenta", "DiffDelete term=bold ctermfg=Blue ctermbg=DarkCyan gui=bold guifg=Blue guibg=DarkCyan", diff --git a/src/version.h b/src/version.h index c5cff3d073..d3e262017b 100644 --- a/src/version.h +++ b/src/version.h @@ -36,5 +36,5 @@ #define VIM_VERSION_NODOT "vim70aa" #define VIM_VERSION_SHORT "7.0aa" #define VIM_VERSION_MEDIUM "7.0aa ALPHA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 10)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 10, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 13)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 13, compiled " |