diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/charset.c | 14 | ||||
-rw-r--r-- | src/edit.c | 14 | ||||
-rw-r--r-- | src/eval.c | 10 | ||||
-rw-r--r-- | src/ex_cmds.c | 2 | ||||
-rw-r--r-- | src/ex_getln.c | 2 | ||||
-rw-r--r-- | src/fileio.c | 29 | ||||
-rw-r--r-- | src/hashtable.c | 2 | ||||
-rw-r--r-- | src/if_cscope.c | 7 | ||||
-rw-r--r-- | src/mbyte.c | 3 | ||||
-rw-r--r-- | src/proto/spell.pro | 2 | ||||
-rw-r--r-- | src/screen.c | 53 | ||||
-rw-r--r-- | src/search.c | 4 | ||||
-rw-r--r-- | src/syntax.c | 7 | ||||
-rw-r--r-- | src/version.h | 4 |
14 files changed, 88 insertions, 65 deletions
diff --git a/src/charset.c b/src/charset.c index 25680f67..33c12f26 100644 --- a/src/charset.c +++ b/src/charset.c @@ -1840,6 +1840,20 @@ skipdigits(p) return p; } +#if defined(FEAT_SYN_HL) || defined(PROTO) +/* + * skip over digits and hex characters + */ + char_u * +skiphex(p) + char_u *p; +{ + while (vim_isxdigit(*p)) /* skip to next non-digit */ + ++p; + return p; +} +#endif + #if defined(FEAT_EX_EXTRA) || defined(PROTO) /* * skip to digit (or NUL after the string) @@ -4568,6 +4568,7 @@ auto_format(trailblank, prev_line) char_u *old; char_u *new, *pnew; int wasatend; + int cc; if (!has_format_option(FO_AUTO)) return; @@ -4587,11 +4588,12 @@ auto_format(trailblank, prev_line) if (*old != NUL && !trailblank && wasatend) { dec_cursor(); - if (!WHITECHAR(gchar_cursor()) - && curwin->w_cursor.col > 0 - && has_format_option(FO_ONE_LETTER)) + cc = gchar_cursor(); + if (!WHITECHAR(cc) && curwin->w_cursor.col > 0 + && has_format_option(FO_ONE_LETTER)) dec_cursor(); - if (WHITECHAR(gchar_cursor())) + cc = gchar_cursor(); + if (WHITECHAR(cc)) { curwin->w_cursor = pos; return; @@ -4672,10 +4674,12 @@ check_auto_format(end_insert) int end_insert; /* TRUE when ending Insert mode */ { int c = ' '; + int cc; if (did_add_space) { - if (!WHITECHAR(gchar_cursor())) + cc = gchar_cursor(); + if (!WHITECHAR(cc)) /* Somehow the space was removed already. */ did_add_space = FALSE; else @@ -5086,7 +5086,7 @@ list_idx_of_item(l, item) ++idx; if (li == NULL) return -1; - return idx;; + return idx; } /* @@ -14820,6 +14820,8 @@ find_var_ht(name, varname) char_u *name; char_u **varname; { + hashitem_T *hi; + if (name[1] != ':') { /* The name must not start with a colon or #. */ @@ -14828,7 +14830,8 @@ find_var_ht(name, varname) *varname = name; /* "version" is "v:version" in all scopes */ - if (!HASHITEM_EMPTY(hash_find(&compat_hashtab, name))) + hi = hash_find(&compat_hashtab, name); + if (!HASHITEM_EMPTY(hi)) return &compat_hashtab; if (current_funccal == NULL) @@ -17650,7 +17653,7 @@ shortpath_for_invalid_fname(fname, bufp, fnamelen) { char_u *s, *p, *pbuf2, *pbuf3; char_u ch; - int l,len,len2,plen,slen; + int len, len2, plen, slen; /* Make a copy */ len2 = *fnamelen; @@ -17661,7 +17664,6 @@ shortpath_for_invalid_fname(fname, bufp, fnamelen) slen = 1; plen = len2; - l = 0; if (after_pathsep(pbuf2, s + 1)) { --s; diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 22627944..bf04185c 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -1813,7 +1813,7 @@ write_viminfo(file, forceit) if (fp_out == NULL) { EMSG2(_("E138: Can't write viminfo file %s!"), - (fp_in == NULL || tempname == NUL) ? fname : tempname); + (fp_in == NULL || tempname == NULL) ? fname : tempname); if (fp_in != NULL) fclose(fp_in); goto end; diff --git a/src/ex_getln.c b/src/ex_getln.c index a71b68ef..5d04ad30 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -5297,7 +5297,7 @@ write_viminfo_history(fp) p = history[type][i].hisstr; if (p != NULL) { - putc(hist_type2char(type, TRUE), fp); + fputc(hist_type2char(type, TRUE), fp); /* For the search history: put the separator in the second * column; use a space if there isn't one. */ if (type == HIST_SEARCH) diff --git a/src/fileio.c b/src/fileio.c index 9f38101b..5b27b624 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -765,6 +765,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags) else if (curbuf->b_help) { char_u firstline[80]; + int fc; /* Help files are either utf-8 or latin1. Try utf-8 first, if this * fails it must be latin1. @@ -774,18 +775,22 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags) * That is only in *.??x files. */ fenc = (char_u *)"latin1"; c = enc_utf8; - if (!c && !read_stdin && TOLOWER_ASC(fname[STRLEN(fname) - 1]) == 'x') - { - /* Read the first line (and a bit more). Immediately rewind to - * the start of the file. If the read() fails "len" is -1. */ - len = vim_read(fd, firstline, 80); - lseek(fd, (off_t)0L, SEEK_SET); - for (p = firstline; p < firstline + len; ++p) - if (*p >= 0x80) - { - c = TRUE; - break; - } + if (!c && !read_stdin) + { + fc = fname[STRLEN(fname) - 1]; + if (TOLOWER_ASC(fc) == 'x') + { + /* Read the first line (and a bit more). Immediately rewind to + * the start of the file. If the read() fails "len" is -1. */ + len = vim_read(fd, firstline, 80); + lseek(fd, (off_t)0L, SEEK_SET); + for (p = firstline; p < firstline + len; ++p) + if (*p >= 0x80) + { + c = TRUE; + break; + } + } } if (c) diff --git a/src/hashtable.c b/src/hashtable.c index a8cd1b7d..d4177d3e 100644 --- a/src/hashtable.c +++ b/src/hashtable.c @@ -275,6 +275,7 @@ hash_lock(ht) ++ht->ht_locked; } +#if 0 /* currently not used */ /* * Lock a hashtable at the specified number of entries. * Caller must make sure no more than "size" entries will be added. @@ -288,6 +289,7 @@ hash_lock_size(ht, size) (void)hash_may_resize(ht, size); ++ht->ht_locked; } +#endif /* * Unlock a hashtable: allow ht_array changes again. diff --git a/src/if_cscope.c b/src/if_cscope.c index 3e5e26ce..7163c8a0 100644 --- a/src/if_cscope.c +++ b/src/if_cscope.c @@ -559,7 +559,7 @@ cs_check_for_connections() static int cs_check_for_tags() { - return (p_tags[0] != NUL && curbuf->b_p_tags != NUL); + return (p_tags[0] != NUL && curbuf->b_p_tags != NULL); } /* cs_check_for_tags */ @@ -1202,6 +1202,9 @@ clear_csinfo(i) csinfo[i].pid = -1; csinfo[i].fr_fp = NULL; csinfo[i].to_fp = NULL; +#if defined(WIN32) + csinfo[i].hProc = NULL; +#endif } #ifndef UNIX @@ -2090,7 +2093,7 @@ cs_release_csp(i, freefnpp) (void)fflush(csinfo[i].to_fp); } /* give cscope chance to exit normally */ - if (csinfo[i].hProc > 0 + if (csinfo[i].hProc != NULL && WaitForSingleObject(csinfo[i].hProc, 1000) == WAIT_TIMEOUT) TerminateProcess(csinfo[i].hProc, 0); #endif diff --git a/src/mbyte.c b/src/mbyte.c index 95040129..71a03a5d 100644 --- a/src/mbyte.c +++ b/src/mbyte.c @@ -426,9 +426,6 @@ mb_init() vimconv_T vimconv; char_u *p; #endif -#ifdef WIN32 - int prev_enc_utf8 = enc_utf8; -#endif if (p_enc == NULL) { diff --git a/src/proto/spell.pro b/src/proto/spell.pro index e56eb929..45cade67 100644 --- a/src/proto/spell.pro +++ b/src/proto/spell.pro @@ -1,5 +1,5 @@ /* spell.c */ -int spell_check __ARGS((win_T *wp, char_u *line, char_u *ptr, int *attrp)); +int spell_check __ARGS((win_T *wp, char_u *ptr, int *attrp)); int spell_move_to __ARGS((int dir, int allwords)); char_u *did_set_spelllang __ARGS((buf_T *buf)); void spell_reload __ARGS((void)); diff --git a/src/screen.c b/src/screen.c index 01397887..8c6dba12 100644 --- a/src/screen.c +++ b/src/screen.c @@ -243,7 +243,7 @@ redraw_all_later(type) } /* - * Mark all windows that are editing the current buffer to be udpated later. + * Mark all windows that are editing the current buffer to be updated later. */ void redraw_curbuf_later(type) @@ -725,7 +725,7 @@ updateWindow(wp) * VALID 1. scroll up/down to adjust for a changed w_topline * 2. update lines at the top when scrolled down * 3. redraw changed text: - * - if wp->w_buffer->b_mod_set set, udpate lines between + * - if wp->w_buffer->b_mod_set set, update lines between * b_mod_top and b_mod_bot. * - if wp->w_redraw_top non-zero, redraw lines between * wp->w_redraw_top and wp->w_redr_bot. @@ -2504,8 +2504,6 @@ win_line(wp, lnum, startrow, endrow) int has_spell = FALSE; /* this buffer has spell checking */ int spell_attr = 0; /* attributes desired by spelling */ int word_end = 0; /* last byte with same spell_attr */ - int iswordc; /* prev. char was a word character */ - int prev_iswordc = FALSE; /* prev. char was a word character */ #endif int extra_check; /* has syntax or linebreak */ #ifdef FEAT_MBYTE @@ -3246,11 +3244,6 @@ win_line(wp, lnum, startrow, endrow) else char_attr = search_attr; -#ifdef FEAT_SYN_HL - if (spell_attr != 0) - char_attr = hl_combine_attr(char_attr, spell_attr); -#endif - #ifdef FEAT_DIFF if (diff_hlf != (enum hlf_value)0 && n_extra == 0) { @@ -3586,9 +3579,11 @@ win_line(wp, lnum, startrow, endrow) if (area_attr == 0 && search_attr == 0) char_attr = syntax_attr; + else + char_attr = hl_combine_attr(char_attr, syntax_attr); } - /* Check spelling at the start of a word. + /* Check spelling (unless at the end of the line). * Only do this when there is no syntax highlighting, there is * on @Spell cluster or the current syntax item contains the * @Spell cluster. */ @@ -3597,33 +3592,27 @@ win_line(wp, lnum, startrow, endrow) spell_attr = 0; if (area_attr == 0 && search_attr == 0) char_attr = syntax_attr; - if (!has_syntax || can_spell) + if (c != 0 && (!has_syntax || can_spell)) { - char_u *prev_ptr = ptr - ( # ifdef FEAT_MBYTE - has_mbyte ? mb_l : + char_u *prev_ptr = ptr - (has_mbyte ? mb_l : 1); +# else + char_u *prev_ptr = ptr - 1; # endif - 1); - - iswordc = spell_iswordc(prev_ptr); - if (iswordc && !prev_iswordc) - { - word_end = v + spell_check(wp, line, prev_ptr, - &spell_attr); - /* In Insert mode only highlight a word that - * doesn't touch the cursor. */ - if (spell_attr != 0 - && (State & INSERT) != 0 - && wp->w_cursor.lnum == lnum - && wp->w_cursor.col >= + word_end = v + spell_check(wp, prev_ptr, &spell_attr); + + /* In Insert mode only highlight a word that + * doesn't touch the cursor. */ + if (spell_attr != 0 + && (State & INSERT) != 0 + && wp->w_cursor.lnum == lnum + && wp->w_cursor.col >= (colnr_T)(prev_ptr - line) - && wp->w_cursor.col < (colnr_T)word_end) - { - spell_attr = 0; - spell_redraw_lnum = lnum; - } + && wp->w_cursor.col < (colnr_T)word_end) + { + spell_attr = 0; + spell_redraw_lnum = lnum; } - prev_iswordc = iswordc; } } if (spell_attr != 0) diff --git a/src/search.c b/src/search.c index 5ffcb367..9d298173 100644 --- a/src/search.c +++ b/src/search.c @@ -375,11 +375,13 @@ ignorecase(pat) #endif if (*p == '\\' && p[1] != NUL) /* skip "\S" et al. */ p += 2; - else if (isupper(*p++)) + else if (isupper(*p)) { ic = FALSE; break; } + else + ++p; } } no_smartcase = FALSE; diff --git a/src/syntax.c b/src/syntax.c index fc2710ab..d8e781a7 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -3143,6 +3143,8 @@ syntax_clear(buf) for (i = buf->b_syn_clusters.ga_len; --i >= 0; ) syn_clear_cluster(buf, i); ga_clear(&buf->b_syn_clusters); + buf->b_spell_cluster_id = 0; + buf->b_nospell_cluster_id = 0; buf->b_syn_sync_flags = 0; buf->b_syn_sync_minlines = 0; @@ -6003,7 +6005,6 @@ static char *(highlight_init_both[]) = "StatusLine term=reverse,bold cterm=reverse,bold gui=reverse,bold", "StatusLineNC term=reverse cterm=reverse gui=reverse", "VertSplit term=reverse cterm=reverse gui=reverse", - "Visual term=reverse cterm=reverse gui=reverse guifg=Grey guibg=fg", "VisualNOS term=underline,bold cterm=underline,bold gui=underline,bold", "DiffText term=reverse cterm=bold ctermbg=Red gui=bold guibg=Red", NULL @@ -6027,6 +6028,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=Blue guibg=Blue", "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", @@ -6051,6 +6053,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=Blue guibg=Blue", "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", @@ -7765,6 +7768,8 @@ highlight_list_one(id) didh = highlight_list_arg(id, didh, LIST_STRING, 0, sgp->sg_gui_bg_name, "guibg"); didh = highlight_list_arg(id, didh, LIST_STRING, + 0, sgp->sg_gui_sp_name, "guisp"); + didh = highlight_list_arg(id, didh, LIST_STRING, 0, sgp->sg_font_name, "font"); #endif diff --git a/src/version.h b/src/version.h index 9b190727..3fa4e3d1 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 Jun 1)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 1, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 4)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jun 4, compiled " |