diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-04-11 21:38:50 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-04-11 21:38:50 +0000 |
commit | 4c3f536f472c7443ed4f672ae6d35a28805d7641 (patch) | |
tree | 18d0d8df6d45ff21449a017068aea2ba0931bd57 /src | |
parent | 779b74b2a23643aaac026341a4ed8bd6e04371e6 (diff) | |
download | vim-git-4c3f536f472c7443ed4f672ae6d35a28805d7641.tar.gz |
updated for version 7.0d01v7.0d01
Diffstat (limited to 'src')
-rw-r--r-- | src/Make_vms.mms | 15 | ||||
-rw-r--r-- | src/dosinst.h | 16 | ||||
-rw-r--r-- | src/edit.c | 3 | ||||
-rw-r--r-- | src/eval.c | 2 | ||||
-rw-r--r-- | src/ex_cmds.c | 133 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/os_mac_rsrc/doc-txt.icns | bin | 40095 -> 40106 bytes | |||
-rw-r--r-- | src/screen.c | 10 | ||||
-rw-r--r-- | src/testdir/test57.in | 534 | ||||
-rw-r--r-- | src/testdir/test57.ok | 490 | ||||
-rw-r--r-- | src/version.h | 6 | ||||
-rw-r--r-- | src/window.c | 33 |
12 files changed, 1109 insertions, 135 deletions
diff --git a/src/Make_vms.mms b/src/Make_vms.mms index 557cb6da4..895b7bc98 100644 --- a/src/Make_vms.mms +++ b/src/Make_vms.mms @@ -2,7 +2,7 @@ # Makefile for Vim on OpenVMS # # Maintainer: Zoltan Arpadffy <arpadffy@polarhome.com> -# Last change: 2006 Mar 31 +# Last change: 2006 Apr 11 # # This has script been tested on VMS 6.2 to 8.2 on DEC Alpha, VAX and IA64 # with MMS and MMK @@ -44,6 +44,7 @@ MODEL = BIG # GUI or terminal mode executable. # Comment out if you want just the character terminal mode only. +# GUI with Motif GUI = YES # GUI with GTK @@ -136,12 +137,24 @@ VIMRUN = "" CONFIG_H = os_vms_conf.h +# GTK or XPM but not both .IFDEF GTK .IFDEF GUI +.ELSE +GUI = YES +.ENDIF .IFDEF XPM +XPM = "" +.ENDIF +.ENDIF + +.IFDEF XPM +.IFDEF GUI .ELSE GUI = YES .ENDIF +.IFDEF GTK +GTK = "" .ENDIF .ENDIF diff --git a/src/dosinst.h b/src/dosinst.h index 485e7cd71..455d2a61d 100644 --- a/src/dosinst.h +++ b/src/dosinst.h @@ -207,6 +207,14 @@ searchpath_save(char *name) } #ifdef WIN3264 + +#ifndef CSIDL_COMMON_PROGRAMS +# define CSIDL_COMMON_PROGRAMS 0x0017 +#endif +#ifndef CSIDL_COMMON_DESKTOPDIRECTORY +# define CSIDL_COMMON_DESKTOPDIRECTORY 0x0019 +#endif + /* * Get the path to a requested Windows shell folder. * @@ -234,22 +242,14 @@ get_shell_folder_path( if (strcmp(shell_folder_name, "desktop") == 0) { pcsidl = &desktop_csidl; -#ifdef CSIDL_COMMON_DESKTOPDIRECTORY csidl = CSIDL_COMMON_DESKTOPDIRECTORY; alt_csidl = CSIDL_DESKTOP; -#else - csidl = CSIDL_DESKTOP; -#endif } else if (strncmp(shell_folder_name, "Programs", 8) == 0) { pcsidl = &programs_csidl; -#ifdef CSIDL_COMMON_PROGRAMS csidl = CSIDL_COMMON_PROGRAMS; alt_csidl = CSIDL_PROGRAMS; -#else - csidl = CSIDL_PROGRAMS; -#endif } else { diff --git a/src/edit.c b/src/edit.c index 08a24d7e7..f2a5cdacd 100644 --- a/src/edit.c +++ b/src/edit.c @@ -2969,6 +2969,9 @@ ins_compl_bs() ins_compl_set_original_text(compl_leader); else { +#ifdef FEAT_SPELL + spell_bad_len = 0; /* need to redetect bad word */ +#endif /* Matches were cleared, need to search for them now. */ if (ins_complete(Ctrl_N) == FAIL) compl_cont_status = 0; diff --git a/src/eval.c b/src/eval.c index 1b75201f8..45efab72c 100644 --- a/src/eval.c +++ b/src/eval.c @@ -16208,7 +16208,7 @@ var2fpos(varp, lnum, fnum) return NULL; len = (long)STRLEN(ml_get(pos.lnum)); /* Accept a position up to the NUL after the line. */ - if (pos.col <= 0 || (int)pos.col > len + 1) + if (pos.col == 0 || (int)pos.col > len + 1) return NULL; /* invalid column number */ --pos.col; diff --git a/src/ex_cmds.c b/src/ex_cmds.c index 9206e0288..9ba3e8141 100644 --- a/src/ex_cmds.c +++ b/src/ex_cmds.c @@ -261,18 +261,23 @@ linelen(has_tab) return len; } -/* Buffer for one line used during sorting. It's allocated to contain the - * longest line being sorted. */ -static char_u *sortbuf; +/* Buffer for two lines used during sorting. They are allocated to + * contain the longest line being sorted. */ +static char_u *sortbuf1; +static char_u *sortbuf2; static int sort_ic; /* ignore case */ static int sort_nr; /* sort on number */ +static int sort_rx; /* sort on regex instead of skipping it */ + +static int sort_abort; /* flag to indicate if sorting has been interrupted */ /* Struct to store info to be sorted. */ typedef struct { linenr_T lnum; /* line number */ - long col_nr; /* column number or number */ + long start_col_nr; /* starting column number or number */ + long end_col_nr; /* ending column number */ } sorti_T; static int @@ -291,18 +296,35 @@ sort_compare(s1, s2) { sorti_T l1 = *(sorti_T *)s1; sorti_T l2 = *(sorti_T *)s2; - char_u *s; + int result = 0; - /* When sorting numbers "col_nr" is the number, not the column number. */ - if (sort_nr) - return l1.col_nr - l2.col_nr; + /* If the user interrupts, there's no way to stop qsort() immediately, but + * if we return 0 every time, qsort will assume it's done sorting and exit */ + if (sort_abort) + return 0; + fast_breakcheck(); + if (got_int) + sort_abort = TRUE; - /* We need to copy one line into "sortbuf", because there is no guarantee - * that the first pointer becomes invalid when obtaining the second one. */ - STRCPY(sortbuf, ml_get(l1.lnum) + l1.col_nr); - s = ml_get(l2.lnum) + l2.col_nr; + /* When sorting numbers "start_col_nr" is the number, not the column number. */ + if (sort_nr) + result = l1.start_col_nr - l2.start_col_nr; + else + { + /* We need to copy one line into "sortbuf1", because there is no guarantee + * that the first pointer becomes invalid when obtaining the second one. */ + STRNCPY(sortbuf1, ml_get(l1.lnum) + l1.start_col_nr, l1.end_col_nr - l1.start_col_nr + 1); + sortbuf1[l1.end_col_nr - l1.start_col_nr] = 0; + STRNCPY(sortbuf2, ml_get(l2.lnum) + l2.start_col_nr, l2.end_col_nr - l2.start_col_nr + 1); + sortbuf2[l2.end_col_nr - l2.start_col_nr] = 0; - return sort_ic ? STRICMP(sortbuf, s) : STRCMP(sortbuf, s); + result = sort_ic ? STRICMP(sortbuf1, sortbuf2) : STRCMP(sortbuf1, sortbuf2); + } + /* If the two lines have the same value, preserve the original line order */ + if (result == 0) + return (int) (l1.lnum - l2.lnum); + else + return result; } /* @@ -321,21 +343,25 @@ ex_sort(eap) size_t i; char_u *p; char_u *s; + char_u *s2; + char_u c; /* temporary character storage */ int unique = FALSE; long deleted; - colnr_T col; + colnr_T start_col; + colnr_T end_col; int sort_oct; /* sort on octal number */ int sort_hex; /* sort on hex number */ if (u_save((linenr_T)(eap->line1 - 1), (linenr_T)(eap->line2 + 1)) == FAIL) return; - sortbuf = NULL; + sortbuf1 = NULL; + sortbuf2 = NULL; regmatch.regprog = NULL; nrs = (sorti_T *)lalloc((long_u)(count * sizeof(sorti_T)), TRUE); if (nrs == NULL) - goto theend; + goto sortend; - sort_ic = sort_nr = sort_oct = sort_hex = 0; + sort_abort = sort_ic = sort_rx = sort_nr = sort_oct = sort_hex = 0; for (p = eap->arg; *p != NUL; ++p) { @@ -343,6 +369,8 @@ ex_sort(eap) ; else if (*p == 'i') sort_ic = TRUE; + else if (*p == 'r') + sort_rx = TRUE; else if (*p == 'n') sort_nr = 2; else if (*p == 'o') @@ -364,19 +392,19 @@ ex_sort(eap) if (*s != *p) { EMSG(_(e_invalpat)); - goto theend; + goto sortend; } *s = NUL; regmatch.regprog = vim_regcomp(p + 1, RE_MAGIC); if (regmatch.regprog == NULL) - goto theend; + goto sortend; p = s; /* continue after the regexp */ regmatch.rm_ic = p_ic; } else { EMSG2(_(e_invarg2), p); - goto theend; + goto sortend; } } @@ -384,7 +412,7 @@ ex_sort(eap) if (sort_nr + sort_oct + sort_hex > 2) { EMSG(_(e_invarg)); - goto theend; + goto sortend; } /* From here on "sort_nr" is used as a flag for any number sorting. */ @@ -393,9 +421,9 @@ ex_sort(eap) /* * Make an array with all line numbers. This avoids having to copy all * the lines into allocated memory. - * When sorting on strings "col_nr" is de offset in the line, for numbers - * sorting it's the number to sort on. This means the pattern matching - * and number conversion only has to be done once per line. + * When sorting on strings "start_col_nr" is the offset in the line, for + * numbers sorting it's the number to sort on. This means the pattern + * matching and number conversion only has to be done once per line. * Also get the longest line length for allocating "sortbuf". */ for (lnum = eap->line1; lnum <= eap->line2; ++lnum) @@ -405,57 +433,83 @@ ex_sort(eap) if (maxlen < len) maxlen = len; + start_col = 0; + end_col = len; if (regmatch.regprog != NULL && vim_regexec(®match, s, 0)) - col = regmatch.endp[0] - s; + { + if (sort_rx) + { + start_col = regmatch.startp[0] - s; + end_col = regmatch.endp[0] - s; + } + else + start_col = regmatch.endp[0] - s; + } else - col = 0; + if (regmatch.regprog != NULL) + end_col = 0; if (sort_nr) { + /* Make sure vim_str2nr doesn't read any digits past the end + * of the match, by temporarily terminating the string there */ + s2 = s + end_col; + c = *s2; + (*s2) = 0; /* Sorting on number: Store the number itself. */ if (sort_hex) - s = skiptohex(s + col); + s = skiptohex(s + start_col); else - s = skiptodigit(s + col); + s = skiptodigit(s + start_col); vim_str2nr(s, NULL, NULL, sort_oct, sort_hex, - &nrs[lnum - eap->line1].col_nr, NULL); + &nrs[lnum - eap->line1].start_col_nr, NULL); + (*s2) = c; } else + { /* Store the column to sort at. */ - nrs[lnum - eap->line1].col_nr = col; + nrs[lnum - eap->line1].start_col_nr = start_col; + nrs[lnum - eap->line1].end_col_nr = end_col; + } nrs[lnum - eap->line1].lnum = lnum; if (regmatch.regprog != NULL) fast_breakcheck(); if (got_int) - goto theend; + goto sortend; } /* Allocate a buffer that can hold the longest line. */ - sortbuf = alloc((unsigned)maxlen + 1); - if (sortbuf == NULL) - goto theend; + sortbuf1 = alloc((unsigned)maxlen + 1); + if (sortbuf1 == NULL) + goto sortend; + sortbuf2 = alloc((unsigned)maxlen + 1); + if (sortbuf2 == NULL) + goto sortend; /* Sort the array of line numbers. Note: can't be interrupted! */ qsort((void *)nrs, count, sizeof(sorti_T), sort_compare); + if (sort_abort) + goto sortend; + /* Insert the lines in the sorted order below the last one. */ lnum = eap->line2; for (i = 0; i < count; ++i) { s = ml_get(nrs[eap->forceit ? count - i - 1 : i].lnum); if (!unique || i == 0 - || (sort_ic ? STRICMP(s, sortbuf) : STRCMP(s, sortbuf)) != 0) + || (sort_ic ? STRICMP(s, sortbuf1) : STRCMP(s, sortbuf1)) != 0) { if (ml_append(lnum++, s, (colnr_T)0, FALSE) == FAIL) break; if (unique) - STRCPY(sortbuf, s); + STRCPY(sortbuf1, s); } fast_breakcheck(); if (got_int) - goto theend; + goto sortend; } /* delete the original lines if appending worked */ @@ -476,9 +530,10 @@ ex_sort(eap) curwin->w_cursor.lnum = eap->line1; beginline(BL_WHITE | BL_FIX); -theend: +sortend: vim_free(nrs); - vim_free(sortbuf); + vim_free(sortbuf1); + vim_free(sortbuf2); vim_free(regmatch.regprog); if (got_int) EMSG(_(e_interr)); diff --git a/src/option.c b/src/option.c index 0a4d9c7dd..d24b2cd9a 100644 --- a/src/option.c +++ b/src/option.c @@ -10252,7 +10252,7 @@ vimrc_found(fname, envname) char_u *envname; { int opt_idx; - int dofree; + int dofree = FALSE; char_u *p; if (!option_was_set((char_u *)"cp")) diff --git a/src/os_mac_rsrc/doc-txt.icns b/src/os_mac_rsrc/doc-txt.icns Binary files differindex 124a7303a..2219e2ce9 100644 --- a/src/os_mac_rsrc/doc-txt.icns +++ b/src/os_mac_rsrc/doc-txt.icns diff --git a/src/screen.c b/src/screen.c index b82bd9831..d371ed9fe 100644 --- a/src/screen.c +++ b/src/screen.c @@ -231,7 +231,15 @@ redraw_win_later(wp, type) redraw_later_clear() { redraw_all_later(CLEAR); - screen_attr = HL_BOLD | HL_UNDERLINE; +#ifdef FEAT_GUI + if (gui.in_use) + /* Use a code that will reset gui.highlight_mask in + * gui_stop_highlight(). */ + screen_attr = HL_ALL + 1; + else +#endif + /* Use attributes that is very unlikely to appear in text. */ + screen_attr = HL_BOLD | HL_UNDERLINE | HL_INVERSE; } /* diff --git a/src/testdir/test57.in b/src/testdir/test57.in index 7e70169ce..d74af5791 100644 --- a/src/testdir/test57.in +++ b/src/testdir/test57.in @@ -3,50 +3,494 @@ Tests for :sort command. vim: set ft=vim : STARTTEST :so small.vim :" -:/^t1:/+1,/^t2/-1sort -:/^t2:/+1,/^t3/-1sort u -:/^t3:/+1,/^t4/-1sort u /[^:]*:/ -:/^t4:/+1,/^t5/-1sort n -:/^t5:/+1,/^t6/-1sort n -[^:]*:- -:/^t6:/+1,/^t7/-1sort o -:/^t7:/+1,/^t8/-1sort x ,.*/, -:/^t8:/+1,/^t9/-1sort n o -:/^t1:/,$wq! test.out +:/^t01:/+1,/^t02/-1sort +:/^t02:/+1,/^t03/-1sort n +:/^t03:/+1,/^t04/-1sort x +:/^t04:/+1,/^t05/-1sort u +:/^t05:/+1,/^t06/-1sort! +:/^t06:/+1,/^t07/-1sort! n +:/^t07:/+1,/^t08/-1sort! u +:/^t08:/+1,/^t09/-1sort o +:/^t09:/+1,/^t10/-1sort! x +:/^t10:/+1,/^t11/-1sort/./ +:/^t11:/+1,/^t12/-1sort/../ +:/^t12:/+1,/^t13/-1sort/../u +:/^t13:/+1,/^t14/-1sort/./n +:/^t14:/+1,/^t15/-1sort/./r +:/^t15:/+1,/^t16/-1sort/../r +:/^t16:/+1,/^t17/-1sort/./rn +:/^t17:/+1,/^t18/-1sort/\d/ +:/^t18:/+1,/^t19/-1sort/\d/r +:/^t19:/+1,/^t20/-1sort/\d/n +:/^t20:/+1,/^t21/-1sort/\d/rn +:/^t21:/+1,/^t22/-1sort/\d\d/ +:/^t22:/+1,/^t23/-1sort/\d\d/n +:/^t23:/+1,/^t24/-1sort/\d\d/x +:/^t24:/+1,/^t25/-1sort/\d\d/r +:/^t25:/+1,/^t26/-1sort/\d\d/rn +:/^t26:/+1,/^t27/-1sort/\d\d/rx +:/^t27:/+1,/^t28/-1sort no +:/^t01:/,$wq! test.out ENDTEST -t1: alphabetical -two test -One test -one test -Two test -t2: alpha, unique -One test -one test -Two test -one test -Two test -t3: alpha, unique, skip pattern -one: xay -two: aaa -another: tuvy -t4: number -asdf 83 asd -one 333 -xce 9 -t5: number and skip -asdf 3 a: sd 11 -one 33:4 99 -:9 -t6: octal -2389 -111 -asdf 0014 -t7: hex and skip -sf/0x1d3 -0x44/1a1 -asd/ad 1413 -t8: wrong arguments -ccc -bbb -aaa -t8: +t01: alphebetical +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t02: numeric +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t03: hexadecimal +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t04: alpha, unique +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t05: alpha, reverse +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t06: numeric, reverse +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t07: unique, reverse +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t08: octal +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t09: reverse, hexadecimal +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t10: alpha, skip first character +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t11: alpha, skip first 2 characters +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t12: alpha, unique, skip first 2 characters +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t13: numeric, skip first character +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t14: alpha, sort on first character +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t15: alpha, sort on first 2 characters +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t16: numeric, sort on first character +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t17: alpha, skip past first digit +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t18: alpha, sort on first digit +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t19: numeric, skip past first digit +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t20: numeric, sort on first digit +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t21: alpha, skip past first 2 digits +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t22: numeric, skip past first 2 digits +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t23: hexadecimal, skip past first 2 digits +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t24: alpha, sort on first 2 digits +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t25: numeric, sort on first 2 digits +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t26: hexadecimal, sort on first 2 digits +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t27: wrong arguments +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t28: done + diff --git a/src/testdir/test57.ok b/src/testdir/test57.ok index 69b98625d..177713342 100644 --- a/src/testdir/test57.ok +++ b/src/testdir/test57.ok @@ -1,35 +1,455 @@ -t1: alphabetical -One test -Two test -one test -two test -t2: alpha, unique -One test -Two test -Two test -one test -t3: alpha, unique, skip pattern -two: aaa -another: tuvy -one: xay -t4: number -xce 9 -asdf 83 asd -one 333 -t5: number and skip -one 33:4 99 -:9 -asdf 3 a: sd 11 -t6: octal -asdf 0014 -2389 -111 -t7: hex and skip -asd/ad 1413 -0x44/1a1 -sf/0x1d3 -t8: wrong arguments -ccc -bbb -aaa -t8: +t01: alphebetical + + + 123b +a +a122 +a123 +a321 +ab +abc +b123 +b321 +b321 +b321b +b322b +c123d +c321d +t02: numeric +abc +ab +a + + +a122 +a123 +b123 +c123d + 123b +a321 +b321 +c321d +b321 +b321b +b322b +t03: hexadecimal + + +a +ab +abc + 123b +a122 +a123 +a321 +b123 +b321 +b321 +b321b +b322b +c123d +c321d +t04: alpha, unique + + 123b +a +a122 +a123 +a321 +ab +abc +b123 +b321 +b321b +b322b +c123d +c321d +t05: alpha, reverse +c321d +c123d +b322b +b321b +b321 +b321 +b123 +abc +ab +a321 +a123 +a122 +a + 123b + + +t06: numeric, reverse +b322b +b321b +b321 +c321d +b321 +a321 + 123b +c123d +b123 +a123 +a122 + + +a +ab +abc +t07: unique, reverse +c321d +c123d +b322b +b321b +b321 +b123 +abc +ab +a321 +a123 +a122 +a + 123b + +t08: octal +abc +ab +a + + +a122 +a123 +b123 +c123d + 123b +a321 +b321 +c321d +b321 +b321b +b322b +t09: reverse, hexadecimal +c321d +c123d +b322b +b321b +b321 +b321 +b123 +a321 +a123 +a122 + 123b +abc +ab +a + + +t10: alpha, skip first character +a + + +a122 +a123 +b123 + 123b +c123d +a321 +b321 +b321 +b321b +c321d +b322b +ab +abc +t11: alpha, skip first 2 characters +ab +a + + +a321 +b321 +b321 +b321b +c321d +a122 +b322b +a123 +b123 + 123b +c123d +abc +t12: alpha, unique, skip first 2 characters +ab +a + +a321 +b321 +b321b +c321d +a122 +b322b +a123 +b123 + 123b +c123d +abc +t13: numeric, skip first character +abc +ab +a + + +a122 +a123 +b123 +c123d + 123b +a321 +b321 +c321d +b321 +b321b +b322b +t14: alpha, sort on first character + + + 123b +abc +ab +a +a321 +a123 +a122 +b321 +b123 +b322b +b321 +b321b +c123d +c321d +t15: alpha, sort on first 2 characters +a + + + 123b +a123 +a122 +a321 +abc +ab +b123 +b321 +b322b +b321 +b321b +c123d +c321d +t16: numeric, sort on first character +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t17: alpha, skip past first digit +abc +ab +a + + +a321 +b321 +b321 +b321b +c321d +a122 +b322b +a123 +b123 + 123b +c123d +t18: alpha, sort on first digit +abc +ab +a + + +a123 +a122 +b123 +c123d + 123b +a321 +b321 +c321d +b322b +b321 +b321b +t19: numeric, skip past first digit +abc +ab +a + + +a321 +b321 +c321d +b321 +b321b +a122 +b322b +a123 +b123 +c123d + 123b +t20: numeric, sort on first digit +abc +ab +a + + +a123 +a122 +b123 +c123d + 123b +a321 +b321 +c321d +b322b +b321 +b321b +t21: alpha, skip past first 2 digits +abc +ab +a + + +a321 +b321 +b321 +b321b +c321d +a122 +b322b +a123 +b123 + 123b +c123d +t22: numeric, skip past first 2 digits +abc +ab +a + + +a321 +b321 +c321d +b321 +b321b +a122 +b322b +a123 +b123 +c123d + 123b +t23: hexadecimal, skip past first 2 digits +abc +ab +a + + +a321 +b321 +b321 +a122 +a123 +b123 +b321b +c321d +b322b + 123b +c123d +t24: alpha, sort on first 2 digits +abc +ab +a + + +a123 +a122 +b123 +c123d + 123b +a321 +b321 +c321d +b322b +b321 +b321b +t25: numeric, sort on first 2 digits +abc +ab +a + + +a123 +a122 +b123 +c123d + 123b +a321 +b321 +c321d +b322b +b321 +b321b +t26: hexadecimal, sort on first 2 digits +abc +ab +a + + +a123 +a122 +b123 +c123d + 123b +a321 +b321 +c321d +b322b +b321 +b321b +t27: wrong arguments +abc +ab +a +a321 +a123 +a122 +b321 +b123 +c123d + 123b +c321d +b322b +b321 +b321b + + +t28: done + diff --git a/src/version.h b/src/version.h index 9358164f3..4b7c05ae5 100644 --- a/src/version.h +++ b/src/version.h @@ -35,6 +35,6 @@ */ #define VIM_VERSION_NODOT "vim70d" #define VIM_VERSION_SHORT "7.0d" -#define VIM_VERSION_MEDIUM "7.0d BETA" -#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0d BETA (2006 Apr 10)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0d BETA (2006 Apr 10, compiled " +#define VIM_VERSION_MEDIUM "7.0d01 BETA" +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0d01 BETA (2006 Apr 11)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0d01 BETA (2006 Apr 11, compiled " diff --git a/src/window.c b/src/window.c index b401fc1eb..5ee8172e3 100644 --- a/src/window.c +++ b/src/window.c @@ -91,6 +91,9 @@ static void win_new_height __ARGS((win_T *, int)); #endif #if defined(FEAT_WINDOWS) || defined(PROTO) + +static char *m_onlyone = N_("Already only one window"); + /* * all CTRL-W window commands are handled here, called from normal_cmd(). */ @@ -330,6 +333,31 @@ newwindow: break; #endif +/* move window to new tab page */ + case 'T': + if (firstwin == lastwin) + MSG(_(m_onlyone)); + else + { + tabpage_T *oldtab = curtab; + tabpage_T *newtab; + win_T *wp = curwin; + + /* First create a new tab with the window, then go back to + * the old tab and close the window there. */ + if (win_new_tabpage((int)Prenum) == OK + && valid_tabpage(oldtab)) + { + newtab = curtab; + goto_tabpage_tp(oldtab); + if (curwin == wp) + win_close(curwin, FALSE); + if (valid_tabpage(newtab)) + goto_tabpage_tp(newtab); + } + } + break; + /* cursor to top-left window */ case 't': case Ctrl_T: @@ -1102,6 +1130,7 @@ win_init(newp, oldp) newp->w_pcmark = oldp->w_pcmark; newp->w_prev_pcmark = oldp->w_prev_pcmark; newp->w_alt_fnum = oldp->w_alt_fnum; + newp->w_wrow = oldp->w_wrow; newp->w_fraction = oldp->w_fraction; newp->w_prev_fraction_row = oldp->w_prev_fraction_row; #ifdef FEAT_JUMPLIST @@ -2938,7 +2967,7 @@ close_others(message, forceit) && !autocmd_busy #endif ) - MSG(_("Already only one window")); + MSG(_(m_onlyone)); return; } @@ -5153,6 +5182,8 @@ win_new_height(wp, height) * Will equalize heights soon to fix it. */ if (height < 0) height = 0; + if (wp->w_height == height) + return; /* nothing to do */ if (wp->w_wrow != wp->w_prev_fraction_row && wp->w_height > 0) wp->w_fraction = ((long)wp->w_wrow * FRACTION_MULT |