diff options
author | Bram Moolenaar <Bram@vim.org> | 2006-01-22 23:30:12 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2006-01-22 23:30:12 +0000 |
commit | 33aec765bdc2096f123c5a4c61f8948a61aa9ef5 (patch) | |
tree | 858b75b899a2ed6cf6e5543a1f29201c04650bd4 /src | |
parent | 71fe80dddd436b36de5d814c1165a3e56b1f0974 (diff) |
updated for version 7.0185v7.0185
Diffstat (limited to 'src')
-rw-r--r-- | src/dosinst.c | 37 | ||||
-rw-r--r-- | src/globals.h | 1 | ||||
-rw-r--r-- | src/gui_beval.c | 8 | ||||
-rw-r--r-- | src/main.c | 14 | ||||
-rw-r--r-- | src/po/cleanup.vim | 1 | ||||
-rw-r--r-- | src/syntax.c | 7 |
6 files changed, 48 insertions, 20 deletions
diff --git a/src/dosinst.c b/src/dosinst.c index efc6fdfee0..41a826708c 100644 --- a/src/dosinst.c +++ b/src/dosinst.c @@ -1194,24 +1194,25 @@ install_vimrc(int idx) fprintf(fd, " if arg2 =~ ' ' | let arg2 = '\"' . arg2 . '\"' | endif\n"); fprintf(fd, " let arg3 = v:fname_out\n"); fprintf(fd, " if arg3 =~ ' ' | let arg3 = '\"' . arg3 . '\"' | endif\n"); - p = strchr(installdir, ' '); - if (p != NULL) - { - /* The path has a space. When using cmd.exe (Win NT/2000/XP) put - * quotes around the whole command and around the diff command. - * Otherwise put a double quote just before the space and at the - * end of the command. Putting quotes around the whole thing - * doesn't work on Win 95/98/ME. This is mostly guessed! */ - fprintf(fd, " if &sh =~ '\\<cmd'\n"); - fprintf(fd, " silent execute '!\"\"%s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . '\"'\n", installdir); - fprintf(fd, " else\n"); - *p = NUL; - fprintf(fd, " silent execute '!%s\" %s\\diff\" ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir, p + 1); - *p = ' '; - fprintf(fd, " endif\n"); - } - else - fprintf(fd, " silent execute '!%s\\diff ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3\n", installdir); + + /* If the path has a space: When using cmd.exe (Win NT/2000/XP) put + * quotes around the whole command and around the diff command. + * Otherwise put a double quote just before the space and at the + * end of the command. Putting quotes around the whole thing + * doesn't work on Win 95/98/ME. This is mostly guessed! */ + fprintf(fd, " let eq = ''\n"); + fprintf(fd, " if $VIMRUNTIME =~ ' '\n"); + fprintf(fd, " if &sh =~ '\\<cmd'\n"); + fprintf(fd, " let cmd = '\"\"' . $VIMRUNTIME . '\\diff\"'\n"); + fprintf(fd, " let eq = '\"'\n"); + fprintf(fd, " else\n"); + fprintf(fd, " let cmd = substitute($VIMRUNTIME, ' ', '\" ', '') . '\\diff\"'\n"); + fprintf(fd, " endif\n"); + fprintf(fd, " else\n"); + fprintf(fd, " let cmd = $VIMRUNTIME . '\\diff'\n"); + fprintf(fd, " endif\n"); + fprintf(fd, " silent execute '!' . cmd . ' ' . opt . arg1 . ' ' . arg2 . ' > ' . arg3 . eq\n"); + fprintf(fd, "endfunction\n"); fprintf(fd, "\n"); } diff --git a/src/globals.h b/src/globals.h index b41c9e0554..9fd9b668cc 100644 --- a/src/globals.h +++ b/src/globals.h @@ -398,6 +398,7 @@ EXTERN int drag_sep_line INIT(= FALSE); /* dragging vert separator */ #ifdef FEAT_DIFF /* Value set from 'diffopt'. */ EXTERN int diff_context INIT(= 6); /* context for folds */ +EXTERN int diff_need_scrollbind INIT(= FALSE); #endif #ifdef FEAT_MENU diff --git a/src/gui_beval.c b/src/gui_beval.c index 755f943100..bb26497fc6 100644 --- a/src/gui_beval.c +++ b/src/gui_beval.c @@ -28,7 +28,9 @@ general_beval_cb(beval, state) char_u *text; static char_u *result = NULL; long winnr = 0; +#ifdef FEAT_WINDOWS win_T *cw; +#endif /* Don't do anything when 'ballooneval' is off, messages scrolled the @@ -40,9 +42,11 @@ general_beval_cb(beval, state) if (*p_bexpr != NUL && get_beval_info(balloonEval, TRUE, &wp, &lnum, &text, &col) == OK) { +# ifdef FEAT_WINDOWS /* Convert window pointer to number. */ for (cw = firstwin; cw != wp; cw = cw->w_next) ++winnr; +# endif set_vim_var_nr(VV_BEVAL_BUFNR, (long)wp->w_buffer->b_fnum); set_vim_var_nr(VV_BEVAL_WINNR, winnr); @@ -293,7 +297,11 @@ get_beval_info(beval, getword, winp, lnump, textp, colp) *textp = NULL; row = Y_2_ROW(beval->y); col = X_2_COL(beval->x); +#ifdef FEAT_WINDOWS wp = mouse_find_win(&row, &col); +#else + wp = firstwin; +#endif if (wp != NULL && row < wp->w_height && col < W_WIDTH(wp)) { /* Found a window and the cursor is in the text. Now find the line diff --git a/src/main.c b/src/main.c index fd85ea89d7..561d6ae4bb 100644 --- a/src/main.c +++ b/src/main.c @@ -988,6 +988,15 @@ main_loop(cmdwin, noexmode) skip_redraw = FALSE; else if (do_redraw || stuff_empty()) { +#if defined(FEAT_DIFF) && defined(FEAT_SCROLLBIND) + /* Scroll-binding for diff mode may have been postponed until + * here. Avoids doing it for every change. */ + if (diff_need_scrollbind) + { + check_scrollbind((linenr_T)0, 0L); + diff_need_scrollbind = FALSE; + } +#endif #if defined(FEAT_FOLDING) && defined(FEAT_VISUAL) /* Include a closed fold completely in the Visual area. */ foldAdjustVisual(); @@ -1153,9 +1162,14 @@ getout(exitval) buf->b_changedtick = -1; /* note that we did it already */ wp = firstwin; /* restart, window may be closed */ } +# ifdef FEAT_WINDOWS else wp = wp->w_next; +# else + break; +# endif } + /* Trigger BufUnload for buffers that are loaded */ for (buf = firstbuf; buf != NULL; buf = buf->b_next) if (buf->b_ml.ml_mfp != NULL) diff --git a/src/po/cleanup.vim b/src/po/cleanup.vim index 78d1e5afe8..a4905c2edf 100644 --- a/src/po/cleanup.vim +++ b/src/po/cleanup.vim @@ -3,6 +3,7 @@ " - Comment-out fuzzy and empty messages. " - Make sure there is a space before the string (required for Solaris). " Requires Vim 6.0 or later (because of multi-line search patterns). +diffoff! silent g/^#: /d silent g/^#, fuzzy\(, .*\)\=\nmsgid ""\@!/.+1,/^$/-1s/^/#\~ / silent g/^msgstr"/s//msgstr "/ diff --git a/src/syntax.c b/src/syntax.c index 1c093a0be3..ab9bcced83 100644 --- a/src/syntax.c +++ b/src/syntax.c @@ -2974,8 +2974,11 @@ syn_add_end_off(result, regmatch, spp, idx, extra) else { /* Don't go past the end of the line. Matters for "rs=e+2" when there - * is a matchgroup. */ - len = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); + * is a matchgroup. Watch out for match with last NL in the buffer. */ + if (result->lnum > syn_buf->b_ml.ml_line_count) + len = 0; + else + len = STRLEN(ml_get_buf(syn_buf, result->lnum, FALSE)); if (col > len) result->col = len; else |