summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2006-05-05 21:15:17 +0000
committerBram Moolenaar <Bram@vim.org>2006-05-05 21:15:17 +0000
commit91170f8ae70cb9a2c15a5d89182f317c18aa0de7 (patch)
tree1633e86e6a00760931319093cec0ea7fc3709893 /src
parentf3a678875fd88038b18b83311075d1250d9d7ca5 (diff)
downloadvim-git-91170f8ae70cb9a2c15a5d89182f317c18aa0de7.tar.gz
updated for version 7.0g04
Diffstat (limited to 'src')
-rw-r--r--src/edit.c12
-rw-r--r--src/gui_gtk.c10
-rw-r--r--src/screen.c42
-rw-r--r--src/search.c4
-rw-r--r--src/testdir/test60.in59
-rw-r--r--src/version.h6
6 files changed, 105 insertions, 28 deletions
diff --git a/src/edit.c b/src/edit.c
index 2ff172273..e298a8c38 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2806,7 +2806,7 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
ptr = find_word_end(ptr);
add_r = ins_compl_add_infercase(regmatch->startp[0],
(int)(ptr - regmatch->startp[0]),
- p_ic, files[i], *dir, 0);
+ FALSE, files[i], *dir, 0);
if (thesaurus)
{
char_u *wstart;
@@ -2842,7 +2842,7 @@ ins_compl_files(count, files, thesaurus, flags, regmatch, buf, dir)
ptr = find_word_end(ptr);
add_r = ins_compl_add_infercase(wstart,
(int)(ptr - wstart),
- p_ic, files[i], *dir, 0);
+ FALSE, files[i], *dir, 0);
}
}
if (add_r == OK)
@@ -3534,7 +3534,7 @@ ins_compl_add_tv(tv, dir)
int dir;
{
char_u *word;
- int icase = p_ic;
+ int icase = FALSE;
int dup = FALSE;
char_u *(cptext[CPT_COUNT]);
@@ -3753,7 +3753,7 @@ ins_compl_get_exp(ini)
TAG_INS_COMP | (ctrl_x_mode ? TAG_VERBOSE : 0),
TAG_MANY, curbuf->b_ffname) == OK && num_matches > 0)
{
- ins_compl_add_matches(num_matches, matches, p_ic);
+ ins_compl_add_matches(num_matches, matches, FALSE);
}
p_ic = save_p_ic;
break;
@@ -3928,7 +3928,7 @@ ins_compl_get_exp(ini)
continue;
}
}
- if (ins_compl_add_infercase(ptr, len, p_ic,
+ if (ins_compl_add_infercase(ptr, len, FALSE,
ins_buf == curbuf ? NULL : ins_buf->b_sfname,
0, flags) != NOTDONE)
{
@@ -5818,7 +5818,7 @@ check_auto_format(end_insert)
*/
int
comp_textwidth(ff)
- int ff; /* force formatting (for "Q" command) */
+ int ff; /* force formatting (for "gq" command) */
{
int textwidth;
diff --git a/src/gui_gtk.c b/src/gui_gtk.c
index 0da144fc9..397b45180 100644
--- a/src/gui_gtk.c
+++ b/src/gui_gtk.c
@@ -2221,16 +2221,6 @@ dialog_key_press_event_cb(GtkWidget *widget, GdkEventKey *event, gpointer data)
{
DialogInfo *di = (DialogInfo *)data;
-#ifndef HAVE_GTK2
- /* Ignore hitting "Enter" if there is no default button. */
- if (event->keyval == GDK_Return)
- {
- if (!di->ignore_enter)
- gtk_dialog_response(di->dialog, GTK_RESPONSE_ACCEPT);
- return TRUE;
- }
-#endif
-
/* Close the dialog when hitting "Esc". */
if (event->keyval == GDK_Escape)
{
diff --git a/src/screen.c b/src/screen.c
index f57adc04d..222cd32a0 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -2626,6 +2626,9 @@ win_line(wp, lnum, startrow, endrow, nochange)
int prev_c = 0; /* previous Arabic character */
int prev_c1 = 0; /* first composing char for prev_c */
#endif
+#if defined(FEAT_DIFF) || defined(LINE_ATTR)
+ int did_line_attr = 0;
+#endif
/* draw_state: items that are drawn in sequence: */
#define WL_START 0 /* nothing done yet */
@@ -4133,6 +4136,13 @@ win_line(wp, lnum, startrow, endrow, nochange)
/* Highlight until the right side of the window */
c = ' ';
--ptr; /* put it back at the NUL */
+
+ /* Remember we do the char for line highlighting. */
+ ++did_line_attr;
+
+ /* don't do search HL for the rest of the line */
+ if (line_attr != 0 && char_attr == search_attr && col > 0)
+ char_attr = line_attr;
# ifdef FEAT_DIFF
if (diff_hlf == HLF_TXD)
{
@@ -4224,22 +4234,34 @@ win_line(wp, lnum, startrow, endrow, nochange)
}
/*
- * At end of the text line.
+ * At end of the text line or just after the last character.
*/
- if (c == NUL)
+ if (c == NUL
+#if defined(FEAT_DIFF) || defined(LINE_ATTR)
+ || did_line_attr == 1
+#endif
+ )
{
+#ifdef FEAT_SEARCH_EXTRA
+ long prevcol = (long)(ptr - line) - (c == NUL);
+#endif
+
/* invert at least one char, used for Visual and empty line or
* highlight match at end of line. If it's beyond the last
* char on the screen, just overwrite that one (tricky!) Not
* needed when a '$' was displayed for 'list'. */
if (lcs_eol == lcs_eol_one
- && ((area_attr != 0 && vcol == fromcol)
+ && ((area_attr != 0 && vcol == fromcol && c == NUL)
#ifdef FEAT_SEARCH_EXTRA
/* highlight 'hlsearch' match at end of line */
- || (ptr - line) - 1 == (long)search_hl.startcol
- || (ptr - line) - 1 == (long)match_hl[0].startcol
- || (ptr - line) - 1 == (long)match_hl[1].startcol
- || (ptr - line) - 1 == (long)match_hl[2].startcol
+ || ((prevcol == (long)search_hl.startcol
+ || prevcol == (long)match_hl[0].startcol
+ || prevcol == (long)match_hl[1].startcol
+ || prevcol == (long)match_hl[2].startcol)
+# if defined(FEAT_DIFF) || defined(LINE_ATTR)
+ && did_line_attr <= 1
+# endif
+ )
#endif
))
{
@@ -4297,7 +4319,13 @@ win_line(wp, lnum, startrow, endrow, nochange)
++col;
++vcol;
}
+ }
+ /*
+ * At end of the text line.
+ */
+ if (c == NUL)
+ {
#ifdef FEAT_SYN_HL
/* Highlight 'cursorcolumn' past end of the line. */
if (wp->w_p_wrap)
diff --git a/src/search.c b/src/search.c
index 0e535ab22..a8a390e1f 100644
--- a/src/search.c
+++ b/src/search.c
@@ -4871,7 +4871,7 @@ search_line:
goto exit_matched;
}
- add_r = ins_compl_add_infercase(aux, i, p_ic,
+ add_r = ins_compl_add_infercase(aux, i, FALSE,
curr_fname == curbuf->b_fname ? NULL : curr_fname,
dir, reuse);
if (add_r == OK)
@@ -5110,7 +5110,7 @@ show_pat_in_path(line, type, did_show, action, fp, lnum, count)
if (did_show)
msg_putchar('\n'); /* cursor below last one */
- else
+ else if (!msg_silent)
gotocmdline(TRUE); /* cursor at status line */
if (got_int) /* 'q' typed at "--more--" message */
return;
diff --git a/src/testdir/test60.in b/src/testdir/test60.in
index 2c414b38e..d5a0d7c28 100644
--- a/src/testdir/test60.in
+++ b/src/testdir/test60.in
@@ -18,6 +18,8 @@ endfunction
" valid autocmd group
let test_cases += [['#myagroup', 1]]
+ " valid autocmd group with garbage
+ let test_cases += [['#myagroup+b', 0]]
" Valid autocmd group and event
let test_cases += [['#myagroup#BufEnter', 1]]
" Valid autocmd group, event and pattern
@@ -51,6 +53,8 @@ endfunction
let test_cases += [['&textwidth', 1]]
" Existing and working option (short form)
let test_cases += [['&tw', 1]]
+ " Existing and working option with garbage
+ let test_cases += [['&tw-', 0]]
" Global option
let test_cases += [['&g:errorformat', 1]]
" Local option
@@ -64,6 +68,8 @@ endfunction
" Existing and working option (long form)
let test_cases += [['+incsearch', 1]]
+ " Existing and working option with garbage
+ let test_cases += [['+incsearch!1', 0]]
" Existing and working option (short form)
let test_cases += [['+is', 1]]
" Existing option that is hidden.
@@ -77,8 +83,12 @@ endfunction
" Valid internal function
let test_cases += [['*bufnr', 1]]
+ " Valid internal function with ()
+ let test_cases += [['*bufnr()', 1]]
" Non-existing internal function
let test_cases += [['*myxyzfunc', 0]]
+ " Valid internal function with garbage
+ let test_cases += [['*bufnr&6', 0]]
" Valid user defined function
let test_cases += [['*TestExists', 1]]
@@ -100,6 +110,14 @@ endfunction
echo "FAILED"
endif
+ " Valid internal command (full match) with garbage
+ echo ':edit/a: 0'
+ if exists(':edit/a') == 0
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Valid internal command (partial match)
echo ':q: 1'
if exists(':q') == 1
@@ -171,6 +189,15 @@ endfunction
echo "FAILED"
endif
+ " Valid local variable with garbage
+ let local_var = 1
+ echo 'local_var%n: 0'
+ if !exists('local_var%n')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Non-existing local variable
unlet local_var
echo 'local_var: 0'
@@ -189,6 +216,30 @@ endfunction
echo "FAILED"
endif
+ " Valid local list item
+ echo 'local_list[1]: 1'
+ if exists('local_list[1]')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
+ " Valid local list item with garbage
+ echo 'local_list[1]+5: 0'
+ if !exists('local_list[1]+5')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
+ " Invalid local list item
+ echo 'local_list[2]: 0'
+ if !exists('local_list[2]')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Non-existing local list
unlet local_list
echo 'local_list: 0'
@@ -245,6 +296,14 @@ endfunction
echo "FAILED"
endif
+ " Existing global variable with garbage
+ echo 'g:global_var-n: 1'
+ if !exists('g:global_var-n')
+ echo "OK"
+ else
+ echo "FAILED"
+ endif
+
" Non-existing global variable
unlet g:global_var
echo 'g:global_var: 0'
diff --git a/src/version.h b/src/version.h
index 6323f460a..389219d49 100644
--- a/src/version.h
+++ b/src/version.h
@@ -35,6 +35,6 @@
*/
#define VIM_VERSION_NODOT "vim70g"
#define VIM_VERSION_SHORT "7.0g"
-#define VIM_VERSION_MEDIUM "7.0g03 BETA"
-#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0g03 BETA (2006 May 4)"
-#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0g03 BETA (2006 May 4, compiled "
+#define VIM_VERSION_MEDIUM "7.0g04 BETA"
+#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0g04 BETA (2006 May 5)"
+#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0g04 BETA (2006 May 5, compiled "