diff options
author | Bram Moolenaar <Bram@vim.org> | 2005-09-25 22:16:38 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2005-09-25 22:16:38 +0000 |
commit | 1e01546026ce909b5fe56c05867f28e77d1b6eb3 (patch) | |
tree | 05ccef65c430097352670acbbeb5520d649ba841 /src | |
parent | bfd8fc0529f46612f7b3efca6c7b3305e70ac374 (diff) | |
download | vim-git-1e01546026ce909b5fe56c05867f28e77d1b6eb3.tar.gz |
updated for version 7.0150
Diffstat (limited to 'src')
-rw-r--r-- | src/diff.c | 9 | ||||
-rw-r--r-- | src/edit.c | 4 | ||||
-rw-r--r-- | src/ex_docmd.c | 4 | ||||
-rw-r--r-- | src/ex_getln.c | 13 | ||||
-rw-r--r-- | src/feature.h | 15 | ||||
-rw-r--r-- | src/fileio.c | 24 | ||||
-rw-r--r-- | src/main.aap | 974 | ||||
-rw-r--r-- | src/message.c | 1 | ||||
-rw-r--r-- | src/move.c | 18 | ||||
-rw-r--r-- | src/option.c | 2 | ||||
-rw-r--r-- | src/quickfix.c | 4 | ||||
-rw-r--r-- | src/spell.c | 32 | ||||
-rw-r--r-- | src/testdir/test59.in | 20 | ||||
-rw-r--r-- | src/version.h | 4 |
14 files changed, 595 insertions, 529 deletions
diff --git a/src/diff.c b/src/diff.c index b6f936e8f..1a382e399 100644 --- a/src/diff.c +++ b/src/diff.c @@ -1905,7 +1905,10 @@ ex_diffgetput(eap) { /* No argument: Find the other buffer in the list of diff buffers. */ for (idx_other = 0; idx_other < DB_COUNT; ++idx_other) - if (diffbuf[idx_other] != curbuf && diffbuf[idx_other] != NULL) + if (diffbuf[idx_other] != curbuf + && diffbuf[idx_other] != NULL + && (eap->cmdidx != CMD_diffput + || diffbuf[idx_other]->b_p_ma)) break; if (idx_other == DB_COUNT) { @@ -1915,7 +1918,9 @@ ex_diffgetput(eap) /* Check that there isn't a third buffer in the list */ for (i = idx_other + 1; i < DB_COUNT; ++i) - if (diffbuf[i] != curbuf && diffbuf[i] != NULL) + if (diffbuf[i] != curbuf + && diffbuf[i] != NULL + && (eap->cmdidx != CMD_diffput || diffbuf[i]->b_p_ma)) { EMSG(_("E101: More than two buffers in diff mode, don't know which one to use")); return; diff --git a/src/edit.c b/src/edit.c index 5b7246135..d9bfb2fb0 100644 --- a/src/edit.c +++ b/src/edit.c @@ -295,6 +295,7 @@ edit(cmdchar, startln, count) */ if (cmdchar != 'r' && cmdchar != 'v') { +# ifdef FEAT_EVAL if (cmdchar == 'R') ptr = (char_u *)"r"; else if (cmdchar == 'V') @@ -302,6 +303,7 @@ edit(cmdchar, startln, count) else ptr = (char_u *)"i"; set_vim_var_string(VV_INSERTMODE, ptr, 1); +# endif apply_autocmds(EVENT_INSERTENTER, NULL, NULL, FALSE, curbuf); } #endif @@ -6580,9 +6582,11 @@ ins_insert(replaceState) #endif #ifdef FEAT_AUTOCMD +# ifdef FEAT_EVAL set_vim_var_string(VV_INSERTMODE, (char_u *)((State & REPLACE_FLAG) ? "i" : replaceState == VREPLACE ? "v" : "r"), 1); +# endif apply_autocmds(EVENT_INSERTCHANGE, NULL, NULL, FALSE, curbuf); #endif if (State & REPLACE_FLAG) diff --git a/src/ex_docmd.c b/src/ex_docmd.c index 72ffc18c4..f88fbf815 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -114,7 +114,6 @@ static int getargopt __ARGS((exarg_T *eap)); # define ex_cc ex_ni # define ex_cnext ex_ni # define ex_cfile ex_ni -# define ex_cexpr ex_ni # define qf_list ex_ni # define qf_age ex_ni # define ex_helpgrep ex_ni @@ -125,6 +124,9 @@ static int getargopt __ARGS((exarg_T *eap)); # define ex_copen ex_ni # define ex_cwindow ex_ni #endif +#if !defined(FEAT_QUICKFIX) || !defined(FEAT_EVAL) +# define ex_cexpr ex_ni +#endif static int check_more __ARGS((int, int)); static linenr_T get_address __ARGS((char_u **, int skip, int to_other_file)); diff --git a/src/ex_getln.c b/src/ex_getln.c index b69076fcc..a3fac10ac 100644 --- a/src/ex_getln.c +++ b/src/ex_getln.c @@ -428,13 +428,10 @@ getcmdline(firstc, count, indent) if (p_wmnu && wild_menu_showing != 0) { int skt = KeyTyped; - int old_RedrawingDisabled; + int old_RedrawingDisabled = RedrawingDisabled; if (ccline.input_fn) - { - old_RedrawingDisabled = RedrawingDisabled; RedrawingDisabled = 0; - } if (wild_menu_showing == WM_SCROLLED) { @@ -463,10 +460,10 @@ getcmdline(firstc, count, indent) # endif redraw_statuslines(); } - if (ccline.input_fn) - RedrawingDisabled = old_RedrawingDisabled; KeyTyped = skt; wild_menu_showing = 0; + if (ccline.input_fn) + RedrawingDisabled = old_RedrawingDisabled; } #endif } @@ -4876,7 +4873,7 @@ set_cmdline_pos(pos) /* * Get the current command-line type. - * Returns ':' or '/' or '?' or '@' or '>' + * Returns ':' or '/' or '?' or '@' or '>' or '-' * Only works when the command line is being edited. * Returns NUL when something is wrong. */ @@ -4887,6 +4884,8 @@ get_cmdline_type() if (p == NULL) return NUL; + if (p->cmdfirstc == NUL) + return (p->input_fn) ? '@' : '-'; return p->cmdfirstc; } diff --git a/src/feature.h b/src/feature.h index 0ab57e93a..e69fcd9f2 100644 --- a/src/feature.h +++ b/src/feature.h @@ -202,13 +202,6 @@ #endif /* - * +textobjects Text objects: "vaw", "das", etc. - */ -#ifdef FEAT_NORMAL -# define FEAT_TEXTOBJ -#endif - -/* * +visual Visual mode. * +visualextra Extra features for Visual mode (mostly block operators). */ @@ -383,12 +376,20 @@ * +profile Profiling for functions and scripts. */ #if defined(FEAT_HUGE) \ + && defined(FEAT_EVAL) \ && ((defined(HAVE_GETTIMEOFDAY) && defined(HAVE_SYS_TIME_H)) \ || defined(WIN3264)) # define FEAT_PROFILE #endif /* + * +textobjects Text objects: "vaw", "das", etc. + */ +#if defined(FEAT_NORMAL) && defined(FEAT_EVAL) +# define FEAT_TEXTOBJ +#endif + +/* * Insert mode completion with 'completefunc'. */ #if defined(FEAT_INS_EXPAND) && defined(FEAT_EVAL) diff --git a/src/fileio.c b/src/fileio.c index 916fdcb5d..e74306196 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -2796,14 +2796,22 @@ buf_write(buf, fname, sfname, start, end, eap, append, forceit, if (!buf_valid(buf)) buf = NULL; if (buf == NULL || (buf->b_ml.ml_mfp == NULL && !empty_memline) - || did_cmd || nofile_err || aborting()) + || did_cmd || nofile_err +#ifdef FEAT_EVAL + || aborting() +#endif + ) { --no_wait_return; msg_scroll = msg_save; if (nofile_err) EMSG(_("E676: No matching autocommands for acwrite buffer")); - if (aborting() || nofile_err) + if (nofile_err +#ifdef FEAT_EVAL + || aborting() +#endif + ) /* An aborting error, interrupt or exception in the * autocommands. */ return FAIL; @@ -6021,8 +6029,10 @@ buf_check_timestamp(buf, focus) * Avoid being called recursively by setting "busy". */ busy = TRUE; +# ifdef FEAT_EVAL set_vim_var_string(VV_FCS_REASON, (char_u *)reason, -1); set_vim_var_string(VV_FCS_CHOICE, (char_u *)"", -1); +# endif n = apply_autocmds(EVENT_FILECHANGEDSHELL, buf->b_fname, buf->b_fname, FALSE, buf); busy = FALSE; @@ -6030,12 +6040,14 @@ buf_check_timestamp(buf, focus) { if (!buf_valid(buf)) EMSG(_("E246: FileChangedShell autocommand deleted buffer")); +# ifdef FEAT_EVAL s = get_vim_var_str(VV_FCS_CHOICE); if (STRCMP(s, "reload") == 0 && *reason != 'd') reload = TRUE; else if (STRCMP(s, "ask") == 0) n = FALSE; else +# endif return 2; } if (!n) @@ -7978,12 +7990,18 @@ apply_autocmds_retval(event, fname, fname_io, force, buf, retval) { int did_cmd; +#ifdef FEAT_EVAL if (should_abort(*retval)) return FALSE; +#endif did_cmd = apply_autocmds_group(event, fname, fname_io, force, AUGROUP_ALL, buf, NULL); - if (did_cmd && aborting()) + if (did_cmd +#ifdef FEAT_EVAL + && aborting() +#endif + ) *retval = FAIL; return did_cmd; } diff --git a/src/main.aap b/src/main.aap index 83a9cd8ed..f31f929ed 100644 --- a/src/main.aap +++ b/src/main.aap @@ -6,15 +6,15 @@ # explanations. # # Optional arguments: -# PREFIX=dir Overrules the install directory. -# Can be specified when installing only. -# Example: aap install PREFIX=$HOME +# PREFIX=dir Overrules the install directory. +# Can be specified when installing only. +# Example: aap install PREFIX=$HOME # # Skip the configure stuff when "link.sh" is executing this recipe recursively # to build pathdef.c or not building something and auto/config.aap does exist. @if ((_no.TARGETARG != "pathdef" and has_build_target()) -@ or not os.path.exists("auto/config.aap")): +@ or not os.path.exists("auto/config.aap")): # # A U T O C O N F @@ -25,9 +25,9 @@ # there is no autoconf program skip this (the signature is often the only # thing that's outdated) auto/configure {signfile = mysign} : configure.in - @if not program_path("autoconf"): - :print Can't find autoconf, using existing configure script. - @else: + @if not program_path("autoconf"): + :print Can't find autoconf, using existing configure script. + @else: # Move configure aside, autoconf would overwrite it :move {exist} configure configure.save :sys autoconf @@ -38,37 +38,37 @@ # Change the configure script to produce config.aap instead of config.mk. auto/configure.aap : auto/configure - :print Adjusting auto/configure for A-A-P. - :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin) - >! auto/configure.aap - :chmod 755 auto/configure.aap + :print Adjusting auto/configure for A-A-P. + :cat auto/configure | :eval re.sub("config.mk", "config.aap", stdin) + >! auto/configure.aap + :chmod 755 auto/configure.aap # The configure script uses the directory where it's located, use a link. configure.aap: {buildcheck=} - :symlink {f} auto/configure.aap configure.aap + :symlink {f} auto/configure.aap configure.aap # Dependency: run configure.aap to update config.h and config.aap in the # "auto" directory. config {virtual} auto/config.h auto/config.aap : - auto/configure.aap configure.aap - config.arg config.h.in config.aap.in - :sys CONFIG_STATUS=auto/config.status + auto/configure.aap configure.aap + config.arg config.h.in config.aap.in + :sys CONFIG_STATUS=auto/config.status ./configure.aap `file2string("config.arg")` --cache-file=auto/config.cache # Configure arguments: create an empty "config.arg" file when its missing config.arg: - :touch {exist} config.arg + :touch {exist} config.arg # "auto/config.aap" contains a lot of settings, such as the name of the # executable "Target". # First update it, forcefully if the "reconfig" target was used. @if _no.TARGETARG != "comment" and _no.TARGETARG != "make": - @if "reconfig" in var2list(_no.TARGETARG): - :del {force} auto/config.cache auto/config.status - :update {force} auto/config.aap - @else: - :update auto/config.aap + @if "reconfig" in var2list(_no.TARGETARG): + :del {force} auto/config.cache auto/config.status + :update {force} auto/config.aap + @else: + :update auto/config.aap # Include the recipe that autoconf generated. :include auto/config.aap @@ -87,93 +87,93 @@ prefix = `os.path.expanduser(prefix)` # :variant GUI GTK - GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c - gui_gtk_f.c - GUI_OBJ = - GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO - GUI_IPATH = $GUI_INC_LOC - GUI_LIBS_DIR = $GUI_LIB_LOC - GUI_LIBS1 = - GUI_LIBS2 = $GTK_LIBNAME - GUI_TARGETS = installglinks - GUI_MAN_TARGETS = installghelplinks - GUI_TESTTARGET = gui + GUI_SRC = gui.c gui_gtk.c gui_gtk_x11.c pty.c gui_beval.c + gui_gtk_f.c + GUI_OBJ = + GUI_DEFS = -DFEAT_GUI_GTK $NARROW_PROTO + GUI_IPATH = $GUI_INC_LOC + GUI_LIBS_DIR = $GUI_LIB_LOC + GUI_LIBS1 = + GUI_LIBS2 = $GTK_LIBNAME + GUI_TARGETS = installglinks + GUI_MAN_TARGETS = installghelplinks + GUI_TESTTARGET = gui KDE - GUI_SRC = gui.c pty.c gui_kde.cc gui_kde_x11.cc + GUI_SRC = gui.c pty.c gui_kde.cc gui_kde_x11.cc gui_kde_wid_moc.cc kvim_iface_skel.cc - GUI_OBJ = $BDIR/gui_kde_wid.o - GUI_DEFS = -DFEAT_GUI_KDE $NARROW_PROTO - GUI_IPATH = $GUI_INC_LOC - GUI_LIBS_DIR = $GUI_LIB_LOC - GUI_LIBS1 = - GUI_LIBS2 = - GUI_TARGETS = installglinks installkdeicons - GUI_MAN_TARGETS = installghelplinks + GUI_OBJ = $BDIR/gui_kde_wid.o + GUI_DEFS = -DFEAT_GUI_KDE $NARROW_PROTO + GUI_IPATH = $GUI_INC_LOC + GUI_LIBS_DIR = $GUI_LIB_LOC + GUI_LIBS1 = + GUI_LIBS2 = + GUI_TARGETS = installglinks installkdeicons + GUI_MAN_TARGETS = installghelplinks GUI_TESTTARGET = gui MOTIF - GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c - gui_xmdlg.c gui_xmebw.c - GUI_OBJ = - GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO - GUI_IPATH = $GUI_INC_LOC - GUI_LIBS_DIR = $GUI_LIB_LOC - GUI_LIBS1 = - GUI_LIBS2 = $MOTIF_LIBNAME -lXt - GUI_TARGETS = installglinks - GUI_MAN_TARGETS = installghelplinks - GUI_TESTTARGET = gui + GUI_SRC = gui.c gui_motif.c gui_x11.c pty.c gui_beval.c + gui_xmdlg.c gui_xmebw.c + GUI_OBJ = + GUI_DEFS = -DFEAT_GUI_MOTIF $NARROW_PROTO + GUI_IPATH = $GUI_INC_LOC + GUI_LIBS_DIR = $GUI_LIB_LOC + GUI_LIBS1 = + GUI_LIBS2 = $MOTIF_LIBNAME -lXt + GUI_TARGETS = installglinks + GUI_MAN_TARGETS = installghelplinks + GUI_TESTTARGET = gui ATHENA - # XAW_LIB et al. can be overruled to use Xaw3d widgets - XAW_LIB ?= -lXaw - GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \ - gui_at_sb.c gui_at_fs.c - GUI_OBJ = - GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO - GUI_IPATH = $GUI_INC_LOC - GUI_LIBS_DIR = $GUI_LIB_LOC - GUI_LIBS1 = $XAW_LIB - GUI_LIBS2 = -lXt - GUI_TARGETS = installglinks - GUI_MAN_TARGETS = installghelplinks - GUI_TESTTARGET = gui + # XAW_LIB et al. can be overruled to use Xaw3d widgets + XAW_LIB ?= -lXaw + GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c \ + gui_at_sb.c gui_at_fs.c + GUI_OBJ = + GUI_DEFS = -DFEAT_GUI_ATHENA $NARROW_PROTO + GUI_IPATH = $GUI_INC_LOC + GUI_LIBS_DIR = $GUI_LIB_LOC + GUI_LIBS1 = $XAW_LIB + GUI_LIBS2 = -lXt + GUI_TARGETS = installglinks + GUI_MAN_TARGETS = installghelplinks + GUI_TESTTARGET = gui NEXTAW - # XAW_LIB et al. can be overruled to use Xaw3d widgets - XAW_LIB ?= -lXaw - GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c - gui_at_fs.c - GUI_OBJ = - GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO - GUI_IPATH = $GUI_INC_LOC - GUI_LIBS_DIR = $GUI_LIB_LOC - GUI_LIBS1 = $NEXTAW_LIB - GUI_LIBS2 = -lXt - GUI_TARGETS = installglinks - GUI_MAN_TARGETS = installghelplinks - GUI_TESTTARGET = gui + # XAW_LIB et al. can be overruled to use Xaw3d widgets + XAW_LIB ?= -lXaw + GUI_SRC = gui.c gui_athena.c gui_x11.c pty.c gui_beval.c + gui_at_fs.c + GUI_OBJ = + GUI_DEFS = -DFEAT_GUI_ATHENA -DFEAT_GUI_NEXTAW $NARROW_PROTO + GUI_IPATH = $GUI_INC_LOC + GUI_LIBS_DIR = $GUI_LIB_LOC + GUI_LIBS1 = $NEXTAW_LIB + GUI_LIBS2 = -lXt + GUI_TARGETS = installglinks + GUI_MAN_TARGETS = installghelplinks + GUI_TESTTARGET = gui PHOTONGUI - GUI_SRC = gui.c gui_photon.c pty.c - GUI_OBJ = - GUI_DEFS = -DFEAT_GUI_PHOTON - GUI_IPATH = - GUI_LIBS_DIR = - GUI_LIBS1 = -lph -lphexlib - GUI_LIBS2 = - GUI_TARGETS = installglinks - GUI_MAN_TARGETS = installghelplinks - GUI_TESTTARGET = gui + GUI_SRC = gui.c gui_photon.c pty.c + GUI_OBJ = + GUI_DEFS = -DFEAT_GUI_PHOTON + GUI_IPATH = + GUI_LIBS_DIR = + GUI_LIBS1 = -lph -lphexlib + GUI_LIBS2 = + GUI_TARGETS = installglinks + GUI_MAN_TARGETS = installghelplinks + GUI_TESTTARGET = gui * - GUI_SRC = - GUI_OBJ = - GUI_DEFS = - GUI_IPATH = - GUI_LIBS_DIR = - GUI_LIBS1 = - GUI_LIBS2 = - GUI_TARGETS = - GUI_MAN_TARGETS = - GUI_TESTTARGET = + GUI_SRC = + GUI_OBJ = + GUI_DEFS = + GUI_IPATH = + GUI_LIBS_DIR = + GUI_LIBS1 = + GUI_LIBS2 = + GUI_TARGETS = + GUI_MAN_TARGETS = + GUI_TESTTARGET = PRE_DEFS = -Iproto -I. $DEFS $GUI_DEFS $GUI_IPATH $CPPFLAGS $?(EXTRA_IPATHS) @@ -216,71 +216,71 @@ CLEANFILES += gui_kde_wid_moc.cc kvim_iface_skel.cc *.kidl # update to a newer version of A-A-P. @if not has_target("fetch"): fetch: - :execute ../main.aap fetch + :execute ../main.aap fetch # All the source files that need to be compiled. # Some are optional and depend on configure. # "version.c" is missing, it's always compiled (see below). Source = - buffer.c - charset.c - diff.c - digraph.c - edit.c - eval.c - ex_cmds.c - ex_cmds2.c - ex_docmd.c - ex_eval.c - ex_getln.c - fileio.c - fold.c - getchar.c + buffer.c + charset.c + diff.c + digraph.c + edit.c + eval.c + ex_cmds.c + ex_cmds2.c + ex_docmd.c + ex_eval.c + ex_getln.c + fileio.c + fold.c + getchar.c hardcopy.c - hashtable.c - if_cscope.c - if_xcmdsrv.c - main.c - mark.c - memfile.c - memline.c - menu.c - message.c - misc1.c - misc2.c - move.c - mbyte.c - normal.c - ops.c - option.c - os_unix.c - auto/pathdef.c - quickfix.c - regexp.c - screen.c - search.c - spell.c - syntax.c - tag.c - term.c - ui.c - undo.c - window.c - $OS_EXTRA_SRC - $GUI_SRC - $HANGULIN_SRC + hashtable.c + if_cscope.c + if_xcmdsrv.c + main.c + mark.c + memfile.c + memline.c + menu.c + message.c + misc1.c + misc2.c + move.c + mbyte.c + normal.c + ops.c + option.c + os_unix.c + auto/pathdef.c + quickfix.c + regexp.c + screen.c + search.c + spell.c + syntax.c + tag.c + term.c + ui.c + undo.c + window.c + $OS_EXTRA_SRC + $GUI_SRC + $HANGULIN_SRC $MZSCHEME_SRC - $PERL_SRC - $NETBEANS_SRC - $PYTHON_SRC - $TCL_SRC - $RUBY_SRC - $SNIFF_SRC - $WORKSHOP_SRC + $PERL_SRC + $NETBEANS_SRC + $PYTHON_SRC + $TCL_SRC + $RUBY_SRC + $SNIFF_SRC + $WORKSHOP_SRC Objects = - $GUI_OBJ + $GUI_OBJ # TODO: make is still used for subdirectories, need to write a recipe. MAKE ?= make @@ -306,48 +306,48 @@ SRCPATH += auto :program $Target : $Source $Objects :action build my_prog object - version_obj = `src2obj("version.c")` - :do compile {target = $version_obj} version.c - #:do build {target = $target {filetype = program}} $source $version_obj - link_sed = $BDIR/link.sed - @if os.path.exists(link_sed): - :move {force} $link_sed auto/link.sed - @else: - :del {force} auto/link.sed - :update link2.sh - :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \ - -o $target $source $version_obj $LIBS" \ - MAKE="aap" sh ./link2.sh - :copy {force} auto/link.sed $BDIR/link.sed + version_obj = `src2obj("version.c")` + :do compile {target = $version_obj} version.c + #:do build {target = $target {filetype = program}} $source $version_obj + link_sed = $BDIR/link.sed + @if os.path.exists(link_sed): + :move {force} $link_sed auto/link.sed + @else: + :del {force} auto/link.sed + :update link2.sh + :sys LINK="$?(PURIFY) $?(SHRPENV) $CC $LDFLAGS \ + -o $target $source $version_obj $LIBS" \ + MAKE="aap" sh ./link2.sh + :copy {force} auto/link.sed $BDIR/link.sed # "link.sh" must be modified for A-A-P link2.sh : link.sh :print Adjusting $-source for A-A-P. :cat $source | :eval re.sub("objects/pathdef.o", "pathdef", stdin) - >! $target + >! $target xxd/xxd$EXESUF: xxd/xxd.c :sys cd xxd; CC="$CC" CFLAGS="$CPPFLAGS $CFLAGS" \ - $MAKE -f Makefile + $MAKE -f Makefile # Build the language specific files if they were unpacked. # Generate the converted .mo files separately, it's no problem if this fails. languages {virtual}: - @if _no.MAKEMO: - :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix - @try: - :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted - @except: - :print Generated converted language files failed, continuing + @if _no.MAKEMO: + :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix + @try: + :sys cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix converted + @except: + :print Generated converted language files failed, continuing # Update the *.po files for changes in the sources. Only run manually. update-po {virtual}: - cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po + cd $PODIR; CC="$CC" $MAKE prefix=$DESTDIR$prefix update-po auto/if_perl.c: if_perl.xs - :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target - :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \ - $PERLLIB/ExtUtils/typemap if_perl.xs >> $target + :sys $PERL -e 'unless ( $$] >= 5.005 ) { for (qw(na defgv errgv)) { print "#define PL_$$_ $$_\n" }}' > $target + :sys $PERL $PERLLIB/ExtUtils/xsubpp -prototypes -typemap \ + $PERLLIB/ExtUtils/typemap if_perl.xs >> $target $BDIR/gui_kde_wid.o: gui_kde_wid.cc :sys $MOC -o gui_kde_wid_moc.cc gui_kde_wid.h @@ -364,63 +364,63 @@ kvim_iface_skel.cc: $BDIR/gui_kde_wid.o auto/osdef.h: auto/config.h osdef.sh osdef1.h.in osdef2.h.in - :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh + :sys CC="$CC $CFLAGS" srcdir=$srcdir sh $srcdir/osdef.sh pathdef {virtual} : $BDIR/auto/pathdef$OBJSUF auto/pathdef.c: auto/config.aap - :print Creating $target - :print >! $target /* pathdef.c */ - :print >> $target /* This file is automatically created by main.aap */ - :print >> $target /* DO NOT EDIT! Change main.aap only. */ - :print >> $target $#include "vim.h" - :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC"; - :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR"; - v = $CC -c -I$srcdir $CFLAGS + :print Creating $target + :print >! $target /* pathdef.c */ + :print >> $target /* This file is automatically created by main.aap */ + :print >> $target /* DO NOT EDIT! Change main.aap only. */ + :print >> $target $#include "vim.h" + :print >> $target char_u *default_vim_dir = (char_u *)"$VIMRCLOC"; + :print >> $target char_u *default_vimruntime_dir = (char_u *)"$?VIMRUNTIMEDIR"; + v = $CC -c -I$srcdir $CFLAGS @v = string.replace(v, '"', '\\"') - :print >> $target char_u *all_cflags = (char_u *)"$v"; - linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS - link_sed = $BDIR/link.sed - @if os.path.exists(link_sed): - # filter $linkcmd through $BDIR/link.sed - :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd + :print >> $target char_u *all_cflags = (char_u *)"$v"; + linkcmd = $CC $LDFLAGS -o $VIMTARGET $LIBS + link_sed = $BDIR/link.sed + @if os.path.exists(link_sed): + # filter $linkcmd through $BDIR/link.sed + :print $linkcmd | :syseval sed -f $link_sed | :eval re.sub("\n", "", stdin) | :assign linkcmd @linkcmd = string.replace(linkcmd, '"', '\\"') - :print >> $target char_u *all_lflags = (char_u *)"$linkcmd"; - @if _no.get("COMPILEDBY"): - who = $COMPILEDBY - where = '' - @else: - :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who + :print >> $target char_u *all_lflags = (char_u *)"$linkcmd"; + @if _no.get("COMPILEDBY"): + who = $COMPILEDBY + where = '' + @else: + :syseval whoami | :eval re.sub("\n", "", stdin) | :assign who - :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where - :print >> $target char_u *compiled_user = (char_u *)"$who"; - :print >> $target char_u *compiled_sys = (char_u *)"$where"; + :syseval hostname | :eval re.sub("\n", "", stdin) | :assign where + :print >> $target char_u *compiled_user = (char_u *)"$who"; + :print >> $target char_u *compiled_sys = (char_u *)"$where"; ### Names of the programs and targets -VIMTARGET = $VIMNAME$EXESUF -EXTARGET = $EXNAME$LNKSUF -VIEWTARGET = $VIEWNAME$LNKSUF -GVIMNAME = g$VIMNAME -GVIMTARGET = $GVIMNAME$LNKSUF -GVIEWNAME = g$VIEWNAME -GVIEWTARGET = $GVIEWNAME$LNKSUF -RVIMNAME = r$VIMNAME -RVIMTARGET = $RVIMNAME$LNKSUF -RVIEWNAME = r$VIEWNAME -RVIEWTARGET = $RVIEWNAME$LNKSUF -RGVIMNAME = r$GVIMNAME -RGVIMTARGET = $RGVIMNAME$LNKSUF -RGVIEWNAME = r$GVIEWNAME -RGVIEWTARGET = $RGVIEWNAME$LNKSUF -VIMDIFFNAME = $(VIMNAME)diff -GVIMDIFFNAME = g$VIMDIFFNAME -VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF -GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF -EVIMNAME = e$VIMNAME -EVIMTARGET = $EVIMNAME$LNKSUF -EVIEWNAME = e$VIEWNAME -EVIEWTARGET = $EVIEWNAME$LNKSUF +VIMTARGET = $VIMNAME$EXESUF +EXTARGET = $EXNAME$LNKSUF +VIEWTARGET = $VIEWNAME$LNKSUF +GVIMNAME = g$VIMNAME +GVIMTARGET = $GVIMNAME$LNKSUF +GVIEWNAME = g$VIEWNAME +GVIEWTARGET = $GVIEWNAME$LNKSUF +RVIMNAME = r$VIMNAME +RVIMTARGET = $RVIMNAME$LNKSUF +RVIEWNAME = r$VIEWNAME +RVIEWTARGET = $RVIEWNAME$LNKSUF +RGVIMNAME = r$GVIMNAME +RGVIMTARGET = $RGVIMNAME$LNKSUF +RGVIEWNAME = r$GVIEWNAME +RGVIEWTARGET = $RGVIEWNAME$LNKSUF +VIMDIFFNAME = $(VIMNAME)diff +GVIMDIFFNAME = g$VIMDIFFNAME +VIMDIFFTARGET = $VIMDIFFNAME$LNKSUF +GVIMDIFFTARGET = $GVIMDIFFNAME$LNKSUF +EVIMNAME = e$VIMNAME +EVIMTARGET = $EVIMNAME$LNKSUF +EVIEWNAME = e$VIEWNAME +EVIEWTARGET = $EVIEWNAME$LNKSUF ### Names of the tools that are also made TOOLS = xxd/xxd$EXESUF @@ -453,67 +453,67 @@ TUTORSUBDIR = /tutor PRINTSUBDIR = /print PODIR = po -### VIMLOC common root of the Vim files (all versions) -### VIMRTLOC common root of the runtime Vim files (this version) -### VIMRCLOC compiled-in location for global [g]vimrc files (all versions) +### VIMLOC common root of the Vim files (all versions) +### VIMRTLOC common root of the runtime Vim files (this version) +### VIMRCLOC compiled-in location for global [g]vimrc files (all versions) ### VIMRUNTIMEDIR compiled-in location for runtime files (optional) -### HELPSUBLOC location for help files -### COLSUBLOC location for colorscheme files -### SYNSUBLOC location for syntax files -### INDSUBLOC location for indent files -### AUTOSUBLOC location for standard autoload files -### PLUGSUBLOC location for standard plugin files +### HELPSUBLOC location for help files +### COLSUBLOC location for colorscheme files +### SYNSUBLOC location for syntax files +### INDSUBLOC location for indent files +### AUTOSUBLOC location for standard autoload files +### PLUGSUBLOC location for standard plugin files ### FTPLUGSUBLOC location for ftplugin files -### LANGSUBLOC location for language files -### COMPSUBLOC location for compiler files -### KMAPSUBLOC location for keymap files -### MACROSUBLOC location for macro files -### TOOLSSUBLOC location for tools files -### TUTORSUBLOC location for tutor files -### PRINTSUBLOC location for print files -### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..) +### LANGSUBLOC location for language files +### COMPSUBLOC location for compiler files +### KMAPSUBLOC location for keymap files +### MACROSUBLOC location for macro files +### TOOLSSUBLOC location for tools files +### TUTORSUBLOC location for tutor files +### PRINTSUBLOC location for print files +### SCRIPTLOC location for script files (menu.vim, bugreport.vim, ..) ### You can override these if you want to install them somewhere else. ### Edit feature.h for compile-time settings. -VIMLOC = $DATADIR$VIMDIR -VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR -VIMRCLOC = $VIMLOC -HELPSUBLOC = $VIMRTLOC$HELPSUBDIR -COLSUBLOC = $VIMRTLOC$COLSUBDIR -SYNSUBLOC = $VIMRTLOC$SYNSUBDIR -INDSUBLOC = $VIMRTLOC$INDSUBDIR -AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR -PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR -FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR -LANGSUBLOC = $VIMRTLOC$LANGSUBDIR -COMPSUBLOC = $VIMRTLOC$COMPSUBDIR -KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR -MACROSUBLOC = $VIMRTLOC$MACROSUBDIR -TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR -TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR -PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR -SCRIPTLOC = $VIMRTLOC +VIMLOC = $DATADIR$VIMDIR +VIMRTLOC = $DATADIR$VIMDIR$VIMRTDIR +VIMRCLOC = $VIMLOC +HELPSUBLOC = $VIMRTLOC$HELPSUBDIR +COLSUBLOC = $VIMRTLOC$COLSUBDIR +SYNSUBLOC = $VIMRTLOC$SYNSUBDIR +INDSUBLOC = $VIMRTLOC$INDSUBDIR +AUTOSUBLOC = $VIMRTLOC$AUTOSUBDIR +PLUGSUBLOC = $VIMRTLOC$PLUGSUBDIR +FTPLUGSUBLOC = $VIMRTLOC$FTPLUGSUBDIR +LANGSUBLOC = $VIMRTLOC$LANGSUBDIR +COMPSUBLOC = $VIMRTLOC$COMPSUBDIR +KMAPSUBLOC = $VIMRTLOC$KMAPSUBDIR +MACROSUBLOC = $VIMRTLOC$MACROSUBDIR +TOOLSSUBLOC = $VIMRTLOC$TOOLSSUBDIR +TUTORSUBLOC = $VIMRTLOC$TUTORSUBDIR +PRINTSUBLOC = $VIMRTLOC$PRINTSUBDIR +SCRIPTLOC = $VIMRTLOC ### Only set VIMRUNTIMEDIR when VIMRTLOC is set to a different location and ### the runtime directory is not below it. #VIMRUNTIMEDIR = $VIMRTLOC ### Name of the evim file target. -EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim -MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim +EVIM_FILE = $DESTDIR$SCRIPTLOC/evim.vim +MSWIN_FILE = $DESTDIR$SCRIPTLOC/mswin.vim ### Name of the menu file target. -SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim +SYS_MENU_FILE = $DESTDIR$SCRIPTLOC/menu.vim SYS_SYNMENU_FILE = $DESTDIR$SCRIPTLOC/synmenu.vim SYS_DELMENU_FILE = $DESTDIR$SCRIPTLOC/delmenu.vim ### Name of the bugreport file target. -SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim +SYS_BUGR_FILE = $DESTDIR$SCRIPTLOC/bugreport.vim ### Name of the file type detection file target. SYS_FILETYPE_FILE = $DESTDIR$SCRIPTLOC/filetype.vim ### Name of the file type detection file target. -SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim +SYS_FTOFF_FILE = $DESTDIR$SCRIPTLOC/ftoff.vim ### Name of the file type detection script file target. SYS_SCRIPTS_FILE = $DESTDIR$SCRIPTLOC/scripts.vim @@ -622,9 +622,9 @@ DEST_MAN = $DESTDIR$MANSUBDIR # These are directories, create them when needed. :attr {directory = $DIRMOD} $DEST_BIN $DEST_VIM $DEST_RT $DEST_HELP $DEST_COL - $DEST_SYN $DEST_IND $DEST_AUTO $DEST_PLUG $DEST_FTP $DEST_LANG - $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR - $DEST_SCRIPT $DEST_PRINT $DEST_MAN + $DEST_SYN $DEST_IND $DEST_AUTO $DEST_PLUG $DEST_FTP $DEST_LANG + $DEST_COMP $DEST_KMAP $DEST_MACRO $DEST_TOOLS $DEST_TUTOR + $DEST_SCRIPT $DEST_PRINT $DEST_MAN # # I N S T A L L @@ -640,235 +640,235 @@ install: :update installvim installtools install-languages install-icons @else: # Bin directory is not writable, need to become root. - :print The destination directory "$DEST_BIN" is not writable. - :print If this is the wrong directory, use PREFIX to specify another one. + :print The destination directory "$DEST_BIN" is not writable. + :print If this is the wrong directory, use PREFIX to specify another one. :print Otherwise, type the root password to continue installing. :asroot $AAP install installvim {virtual}: installvimbin installruntime installlinks \ - installhelplinks installmacros installtutor + installhelplinks installmacros installtutor installvimbin {virtual}{force}: $Target $DEST_BIN - exe = $DEST_BIN/$VIMTARGET - @if os.path.exists(exe): - # Move the old executable aside and delete it. Any other method - # may cause a crash if the executable is currently being used. - :move {force} $exe $(exe).rm - :del {force} $(exe).rm - :copy $VIMTARGET $DEST_BIN - :do strip $exe - :chmod $BINMOD $DEST_BIN/$VIMTARGET + exe = $DEST_BIN/$VIMTARGET + @if os.path.exists(exe): + # Move the old executable aside and delete it. Any other method + # may cause a crash if the executable is currently being used. + :move {force} $exe $(exe).rm + :del {force} $(exe).rm + :copy $VIMTARGET $DEST_BIN + :do strip $exe + :chmod $BINMOD $DEST_BIN/$VIMTARGET # may create a link to the new executable from /usr/bin/vi - @if _no.get("LINKIT"): - :sys $LINKIT + @if _no.get("LINKIT"): + :sys $LINKIT # install the help files; first adjust the contents for the location installruntime {virtual}{force}: $HELPSOURCE/vim.1 $DEST_MAN $DEST_VIM - $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND - $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP + $DEST_RT $DEST_HELP $DEST_COL $DEST_SYN $DEST_IND + $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_TUTOR $DEST_COMP $DEST_PRINT - :print generating $DEST_MAN/$(VIMNAME).1 - :cat $HELPSOURCE/vim.1 | - :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) | - :eval re.sub(_no.VIMLOC + "/doc", _no.HELPSUBLOC, stdin) | - :eval re.sub(_no.VIMLOC + "/syntax", _no.SYNSUBLOC, stdin) | - :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) | - :eval re.sub(_no.VIMLOC + "/vimrc", - _no.VIMRCLOC + "/vimrc", stdin) | - :eval re.sub(_no.VIMLOC + "/gvimrc", - _no.VIMRCLOC + "/gvimrc", stdin) | - :eval re.sub(_no.VIMLOC + "/menu.vim", - _no.SCRIPTLOC + "/menu.vim", stdin) | - :eval re.sub(_no.VIMLOC + "/bugreport.vim", - _no.SCRIPTLOC + "/bugreport.vim", stdin) | - :eval re.sub(_no.VIMLOC + "/filetype.vim", - _no.SCRIPTLOC + "/filetype.vim", stdin) | - :eval re.sub(_no.VIMLOC + "/ftoff.vim", - _no.SCRIPTLOC + "/ftoff.vim", stdin) | - :eval re.sub(_no.VIMLOC + "/scripts.vim", - _no.SCRIPTLOC + "/scripts.vim", stdin) | - :eval re.sub(_no.VIMLOC + "/optwin.vim", - _no.SCRIPTLOC + "/optwin.vim", stdin) | - :eval re.sub(_no.VIMLOC + "/\\*.ps", - _no.SCRIPTLOC + "/*.ps", stdin) - >! $DEST_MAN/$(VIMNAME).1 - :chmod $MANMOD $DEST_MAN/$(VIMNAME).1 - - :print generating $DEST_MAN/$(VIMNAME)tutor.1 - :cat $HELPSOURCE/vimtutor.1 | - :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) | - :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) - >! $DEST_MAN/$(VIMNAME)tutor.1 - :chmod $MANMOD $DEST_MAN/$(VIMNAME)tutor.1 - - :copy $HELPSOURCE/vimdiff.1 $DEST_MAN/$(VIMDIFFNAME).1 - :chmod $MANMOD $DEST_MAN/$(VIMDIFFNAME).1 - - :print generating $DEST_MAN/$(EVIMNAME).1 - :cat $HELPSOURCE/evim.1 | - :eval re.sub("/usr/local/lib/vim", _no.SCRIPTLOC, stdin) - >! $DEST_MAN/$(EVIMNAME).1 - :chmod $MANMOD $DEST_MAN/$(EVIMNAME).1 + :print generating $DEST_MAN/$(VIMNAME).1 + :cat $HELPSOURCE/vim.1 | + :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) | + :eval re.sub(_no.VIMLOC + "/doc", _no.HELPSUBLOC, stdin) | + :eval re.sub(_no.VIMLOC + "/syntax", _no.SYNSUBLOC, stdin) | + :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) | + :eval re.sub(_no.VIMLOC + "/vimrc", + _no.VIMRCLOC + "/vimrc", stdin) | + :eval re.sub(_no.VIMLOC + "/gvimrc", + _no.VIMRCLOC + "/gvimrc", stdin) | + :eval re.sub(_no.VIMLOC + "/menu.vim", + _no.SCRIPTLOC + "/menu.vim", stdin) | + :eval re.sub(_no.VIMLOC + "/bugreport.vim", + _no.SCRIPTLOC + "/bugreport.vim", stdin) | + :eval re.sub(_no.VIMLOC + "/filetype.vim", + _no.SCRIPTLOC + "/filetype.vim", stdin) | + :eval re.sub(_no.VIMLOC + "/ftoff.vim", + _no.SCRIPTLOC + "/ftoff.vim", stdin) | + :eval re.sub(_no.VIMLOC + "/scripts.vim", + _no.SCRIPTLOC + "/scripts.vim", stdin) | + :eval re.sub(_no.VIMLOC + "/optwin.vim", + _no.SCRIPTLOC + "/optwin.vim", stdin) | + :eval re.sub(_no.VIMLOC + "/\\*.ps", + _no.SCRIPTLOC + "/*.ps", stdin) + >! $DEST_MAN/$(VIMNAME).1 + :chmod $MANMOD $DEST_MAN/$(VIMNAME).1 + + :print generating $DEST_MAN/$(VIMNAME)tutor.1 + :cat $HELPSOURCE/vimtutor.1 | + :eval re.sub("/usr/local/lib/vim", _no.VIMLOC, stdin) | + :eval re.sub(_no.VIMLOC + "/tutor", _no.TUTORSUBLOC, stdin) + >! $DEST_MAN/$(VIMNAME)tutor.1 + :chmod $MANMOD $DEST_MAN/$(VIMNAME)tutor.1 + + :copy $HELPSOURCE/vimdiff.1 $DEST_MAN/$(VIMDIFFNAME).1 + :chmod $MANMOD $DEST_MAN/$(VIMDIFFNAME).1 + + :print generating $DEST_MAN/$(EVIMNAME).1 + :cat $HELPSOURCE/evim.1 | + :eval re.sub("/usr/local/lib/vim", _no.SCRIPTLOC, stdin) + >! $DEST_MAN/$(EVIMNAME).1 + :chmod $MANMOD $DEST_MAN/$(EVIMNAME).1 :cd $HELPSOURCE @try: XTRA = `glob.glob("*.??x")` `glob.glob("tags-??")` @except: XTRA = # It's OK if there are no matches. - :copy *.txt tags $XTRA $DEST_HELP + :copy *.txt tags $XTRA $DEST_HELP :cd - :cd $DEST_HELP - :chmod $HELPMOD *.txt tags $XTRA + :chmod $HELPMOD *.txt tags $XTRA :cd - - :copy $HELPSOURCE/*.pl $DEST_HELP - :chmod $SCRIPTMOD $DEST_HELP/*.pl + :copy $HELPSOURCE/*.pl $DEST_HELP + :chmod $SCRIPTMOD $DEST_HELP/*.pl # install the menu files - :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE - :chmod $VIMSCRIPTMOD $SYS_MENU_FILE - :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE - :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE - :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE - :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE + :copy $SCRIPTSOURCE/menu.vim $SYS_MENU_FILE + :chmod $VIMSCRIPTMOD $SYS_MENU_FILE + :copy $SCRIPTSOURCE/synmenu.vim $SYS_SYNMENU_FILE + :chmod $VIMSCRIPTMOD $SYS_SYNMENU_FILE + :copy $SCRIPTSOURCE/delmenu.vim $SYS_DELMENU_FILE + :chmod $VIMSCRIPTMOD $SYS_DELMENU_FILE # install the evim file - :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE - :chmod $VIMSCRIPTMOD $MSWIN_FILE - :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE - :chmod $VIMSCRIPTMOD $EVIM_FILE + :copy $SCRIPTSOURCE/mswin.vim $MSWIN_FILE + :chmod $VIMSCRIPTMOD $MSWIN_FILE + :copy $SCRIPTSOURCE/evim.vim $EVIM_FILE + :chmod $VIMSCRIPTMOD $EVIM_FILE # install the bugreport file - :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE - :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE + :copy $SCRIPTSOURCE/bugreport.vim $SYS_BUGR_FILE + :chmod $VIMSCRIPTMOD $SYS_BUGR_FILE # install the example vimrc files - :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT - :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim - :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT - :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim + :copy $SCRIPTSOURCE/vimrc_example.vim $DEST_SCRIPT + :chmod $VIMSCRIPTMOD $DEST_SCRIPT/vimrc_example.vim + :copy $SCRIPTSOURCE/gvimrc_example.vim $DEST_SCRIPT + :chmod $VIMSCRIPTMOD $DEST_SCRIPT/gvimrc_example.vim # install the file type detection files - :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE - :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE - :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE - :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE - :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE - :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE - :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE - :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE - :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE - :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE - :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE - :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE - :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE - :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE - :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE - :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE + :copy $SCRIPTSOURCE/filetype.vim $SYS_FILETYPE_FILE + :chmod $VIMSCRIPTMOD $SYS_FILETYPE_FILE + :copy $SCRIPTSOURCE/ftoff.vim $SYS_FTOFF_FILE + :chmod $VIMSCRIPTMOD $SYS_FTOFF_FILE + :copy $SCRIPTSOURCE/scripts.vim $SYS_SCRIPTS_FILE + :chmod $VIMSCRIPTMOD $SYS_SCRIPTS_FILE + :copy $SCRIPTSOURCE/ftplugin.vim $SYS_FTPLUGIN_FILE + :chmod $VIMSCRIPTMOD $SYS_FTPLUGIN_FILE + :copy $SCRIPTSOURCE/ftplugof.vim $SYS_FTPLUGOF_FILE + :chmod $VIMSCRIPTMOD $SYS_FTPLUGOF_FILE + :copy $SCRIPTSOURCE/indent.vim $SYS_INDENT_FILE + :chmod $VIMSCRIPTMOD $SYS_INDENT_FILE + :copy $SCRIPTSOURCE/indoff.vim $SYS_INDOFF_FILE + :chmod $VIMSCRIPTMOD $SYS_INDOFF_FILE + :copy $SCRIPTSOURCE/optwin.vim $SYS_OPTWIN_FILE + :chmod $VIMSCRIPTMOD $SYS_OPTWIN_FILE # install the print resource files - :copy $PRINTSOURCE/*.ps $DEST_PRINT - :chmod $FILEMOD $DEST_PRINT/*.ps + :copy $PRINTSOURCE/*.ps $DEST_PRINT + :chmod $FILEMOD $DEST_PRINT/*.ps # install the colorscheme files - :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL - :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt + :copy $COLSOURCE/*.vim $COLSOURCE/README.txt $DEST_COL + :chmod $HELPMOD $DEST_COL/*.vim $DEST_COL/README.txt # install the syntax files - :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN - :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt + :copy $SYNSOURCE/*.vim $SYNSOURCE/README.txt $DEST_SYN + :chmod $HELPMOD $DEST_SYN/*.vim $DEST_SYN/README.txt # install the indent files - :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND - :chmod $HELPMOD $DEST_IND/*.vim + :copy $INDSOURCE/*.vim $INDSOURCE/README.txt $DEST_IND + :chmod $HELPMOD $DEST_IND/*.vim # install the standard autoload files - :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO - :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt + :copy $AUTOSOURCE/*.vim $AUTOSOURCE/README.txt $DEST_AUTO + :chmod $HELPMOD $DEST_AUTO/*.vim $DEST_AUTO/README.txt # install the standard plugin files - :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG - :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt + :copy $PLUGSOURCE/*.vim $PLUGSOURCE/README.txt $DEST_PLUG + :chmod $HELPMOD $DEST_PLUG/*.vim $DEST_PLUG/README.txt # install the ftplugin files - :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP - :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt + :copy $FTPLUGSOURCE/*.vim $FTPLUGSOURCE/README.txt $DEST_FTP + :chmod $HELPMOD $DEST_FTP/*.vim $DEST_FTP/README.txt # install the compiler files - :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP - :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt + :copy $COMPSOURCE/*.vim $COMPSOURCE/README.txt $DEST_COMP + :chmod $HELPMOD $DEST_COMP/*.vim $DEST_COMP/README.txt installmacros {virtual}{force}: $MACROSOURCE $DEST_VIM $DEST_RT $DEST_MACRO - :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO - # Delete any CVS and AAPDIR directories. - # Use the ":tree" command if possible. It was added later, fall back - # to using "find" when it doesn't work. - @try: - :tree $DEST_MACRO {dirname = CVS} - :del {recursive} $name - :tree $DEST_MACRO {dirname = AAPDIR} - :del {recursive} $name - :tree $DEST_MACRO {dirname = .*} - :chmod $DIRMOD $name - :tree $DEST_MACRO {filename = .*} - :chmod $FILEMOD $name - @except: - @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO) - @ if ok and cvsdirs: - :del {recursive} $cvsdirs - :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print`` - :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print`` - :chmod $SCRIPTMOD $DEST_MACRO/less.sh + :copy {recursive}{force} $MACROSOURCE/* $DEST_MACRO + # Delete any CVS and AAPDIR directories. + # Use the ":tree" command if possible. It was added later, fall back + # to using "find" when it doesn't work. + @try: + :tree $DEST_MACRO {dirname = CVS} + :del {recursive} $name + :tree $DEST_MACRO {dirname = AAPDIR} + :del {recursive} $name + :tree $DEST_MACRO {dirname = .*} + :chmod $DIRMOD $name + :tree $DEST_MACRO {filename = .*} + :chmod $FILEMOD $name + @except: + @ ok, cvsdirs = redir_system('find %s -name CVS -print' % _no.DEST_MACRO) + @ if ok and cvsdirs: + :del {recursive} $cvsdirs + :sys chmod $DIRMOD ``find $DEST_MACRO -type d -print`` + :sys chmod $FILEMOD ``find $DEST_MACRO -type f -print`` + :chmod $SCRIPTMOD $DEST_MACRO/less.sh # install the tutor files installtutor {virtual}{force}: $TUTORSOURCE $DEST_VIM $DEST_RT $DEST_TUTOR - :copy vimtutor $DEST_BIN/$(VIMNAME)tutor - :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor - :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR - :chmod $HELPMOD $DEST_TUTOR/* + :copy vimtutor $DEST_BIN/$(VIMNAME)tutor + :chmod $SCRIPTMOD $DEST_BIN/$(VIMNAME)tutor + :copy $TUTORSOURCE/tutor* $TUTORSOURCE/README* $DEST_TUTOR + :chmod $HELPMOD $DEST_TUTOR/* # install helper program xxd installtools {virtual}{force}: $TOOLS $DEST_BIN $DEST_MAN \ - $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS - xxd = $DEST_BIN/xxd$EXESUF - @if os.path.exists(xxd): - :move {force} $xxd $(xxd).rm - :del $(xxd).rm - :copy xxd/xxd$EXESUF $DEST_BIN - :do strip $DEST_BIN/xxd$EXESUF - :chmod $BINMOD $DEST_BIN/xxd$EXESUF - :copy $HELPSOURCE/xxd.1 $DEST_MAN - :chmod $MANMOD $DEST_MAN/xxd.1 + $TOOLSSOURCE $DEST_VIM $DEST_RT $DEST_TOOLS + xxd = $DEST_BIN/xxd$EXESUF + @if os.path.exists(xxd): + :move {force} $xxd $(xxd).rm + :del $(xxd).rm + :copy xxd/xxd$EXESUF $DEST_BIN + :do strip $DEST_BIN/xxd$EXESUF + :chmod $BINMOD $DEST_BIN/xxd$EXESUF + :copy $HELPSOURCE/xxd.1 $DEST_MAN + :chmod $MANMOD $DEST_MAN/xxd.1 # install the runtime tools - @try: - @ if aap_has(":tree"): - # New method: copy everything and delete CVS and AAPDIR dirs - :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS - :tree $DEST_TOOLS {dirname = CVS} - :delete {recursive} $name - :tree $DEST_TOOLS {dirname = AAPDIR} - :delete {recursive} $name - @except: - # Old method: copy only specific files and directories. - :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS - :chmod $FILEMOD $DEST_TOOLS/* + @try: + @ if aap_has(":tree"): + # New method: copy everything and delete CVS and AAPDIR dirs + :copy {recursive} $TOOLSSOURCE/* $DEST_TOOLS + :tree $DEST_TOOLS {dirname = CVS} + :delete {recursive} $name + :tree $DEST_TOOLS {dirname = AAPDIR} + :delete {recursive} $name + @except: + # Old method: copy only specific files and directories. + :copy {recursive} $TOOLSSOURCE/README.txt $TOOLSSOURCE/[a-z]* $DEST_TOOLS + :chmod $FILEMOD $DEST_TOOLS/* # replace the path in some tools - :progsearch perlpath perl - @if perlpath: - :cat $TOOLSSOURCE/efm_perl.pl | - :eval re.sub("/usr/bin/perl", perlpath, stdin) - >! $DEST_TOOLS/efm_perl.pl - @else: - :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS - - :progsearch awkpath nawk gawk awk - @if awkpath: - :cat $TOOLSSOURCE/mve.awk | - :eval re.sub("/usr/bin/nawk", awkpath, stdin) - >! $DEST_TOOLS/mve.awk - @else: - :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS - - :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*`` + :progsearch perlpath perl + @if perlpath: + :cat $TOOLSSOURCE/efm_perl.pl | + :eval re.sub("/usr/bin/perl", perlpath, stdin) + >! $DEST_TOOLS/efm_perl.pl + @else: + :copy $TOOLSSOURCE/efm_perl.pl $DEST_TOOLS + + :progsearch awkpath nawk gawk awk + @if awkpath: + :cat $TOOLSSOURCE/mve.awk | + :eval re.sub("/usr/bin/nawk", awkpath, stdin) + >! $DEST_TOOLS/mve.awk + @else: + :copy $TOOLSSOURCE/mve.awk $DEST_TOOLS + + :sys chmod $SCRIPTMOD ``grep -l "^#!" $DEST_TOOLS/*`` # install the language specific files, if they were unpacked install-languages {virtual}{force}: languages $DEST_LANG $DEST_KMAP - @if _no.MAKEMO: - :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \ - LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install - @if os.path.exists(_no.LANGSOURCE): - :print installing language files - :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG - :chmod $FILEMOD $DEST_LANG/*.vim - @if os.path.exists(_no.KMAPSOURCE): - :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP - :chmod $FILEMOD $DEST_KMAP/*.vim + @if _no.MAKEMO: + :sys cd $PODIR; $MAKE prefix=$DESTDIR$prefix \ + LOCALEDIR=$DEST_LANG INSTALL_DATA=cp FILEMOD=$FILEMOD install + @if os.path.exists(_no.LANGSOURCE): + :print installing language files + :copy $LANGSOURCE/README.txt $LANGSOURCE/*.vim $DEST_LANG + :chmod $FILEMOD $DEST_LANG/*.vim + @if os.path.exists(_no.KMAPSOURCE): + :copy $KMAPSOURCE/README.txt $KMAPSOURCE/*.vim $DEST_KMAP + :chmod $FILEMOD $DEST_KMAP/*.vim # Install the icons for the KDE GUI. This differs from the KDE icons for # other GUIs. @@ -890,38 +890,38 @@ ICON32PATH = $DESTDIR$DATADIR/icons/locolor/32x32/apps ICON16PATH = $DESTDIR$DATADIR/icons/locolor/16x16/apps KDEPATH = $HOME/.kde/share/icons install-icons {virtual}: - gp = $ICON48PATH/gvim.png - @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp): - :copy $SCRIPTSOURCE/vim48x48.png $gp - gp = $ICON32PATH/gvim.png - @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp): - :copy $SCRIPTSOURCE/vim32x32.png $gp - gp = $ICON16PATH/gvim.png - @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp): - :copy $SCRIPTSOURCE/vim16x16.png $gp + gp = $ICON48PATH/gvim.png + @if os.path.isdir(_no.ICON48PATH) and not os.path.exists(gp): + :copy $SCRIPTSOURCE/vim48x48.png $gp + gp = $ICON32PATH/gvim.png + @if os.path.isdir(_no.ICON32PATH) and not os.path.exists(gp): + :copy $SCRIPTSOURCE/vim32x32.png $gp + gp = $ICON16PATH/gvim.png + @if os.path.isdir(_no.ICON16PATH) and not os.path.exists(gp): + :copy $SCRIPTSOURCE/vim16x16.png $gp $HELPSOURCE/vim.1 $MACROSOURCE $TOOLSSOURCE: - @if not os.path.exists(_no.TOOLSSOURCE): - :print Runtime files not found. - :error You need to unpack the runtime archive before running "make install". + @if not os.path.exists(_no.TOOLSSOURCE): + :print Runtime files not found. + :error You need to unpack the runtime archive before running "make install". # create links from various names to vim. This is only done when the links # (or executables with the same name) don't exist yet. installlinks {virtual}: $GUI_TARGETS \ - $DEST_BIN/$EXTARGET \ - $DEST_BIN/$VIEWTARGET \ - $DEST_BIN/$RVIMTARGET \ - $DEST_BIN/$RVIEWTARGET \ - $INSTALLVIMDIFF + $DEST_BIN/$EXTARGET \ + $DEST_BIN/$VIEWTARGET \ + $DEST_BIN/$RVIMTARGET \ + $DEST_BIN/$RVIEWTARGET \ + $INSTALLVIMDIFF installglinks {virtual}: $DEST_BIN/$GVIMTARGET \ - $DEST_BIN/$GVIEWTARGET \ - $DEST_BIN/$RGVIMTARGET \ - $DEST_BIN/$RGVIEWTARGET \ - $DEST_BIN/$EVIMTARGET \ - $DEST_BIN/$EVIEWTARGET \ - $INSTALLGVIMDIFF + $DEST_BIN/$GVIEWTARGET \ + $DEST_BIN/$RGVIMTARGET \ + $DEST_BIN/$RGVIEWTARGET \ + $DEST_BIN/$EVIMTARGET \ + $DEST_BIN/$EVIEWTARGET \ + $INSTALLGVIMDIFF installvimdiff {virtual}: $DEST_BIN/$VIMDIFFTARGET installgvimdiff {virtual}: $DEST_BIN/$GVIMDIFFTARGET @@ -964,20 +964,20 @@ $DEST_BIN/$EVIMTARGET: {buildcheck = } $DEST_BIN/$EVIEWTARGET: {buildcheck = } :sys cd $DEST_BIN; ln -s $VIMTARGET $EVIEWTARGET -# create links for the manual pages with various names to vim. This is only +# create links for the manual pages with various names to vim. This is only # done when the links (or manpages with the same name) don't exist yet. installhelplinks {virtual}: $GUI_MAN_TARGETS \ - $DEST_MAN/$(EXNAME).1 \ - $DEST_MAN/$(VIEWNAME).1 \ - $DEST_MAN/$(RVIMNAME).1 \ - $DEST_MAN/$(RVIEWNAME).1 + $DEST_MAN/$(EXNAME).1 \ + $DEST_MAN/$(VIEWNAME).1 \ + $DEST_MAN/$(RVIMNAME).1 \ + $DEST_MAN/$(RVIEWNAME).1 installghelplinks {virtual}: $DEST_MAN/$(GVIMNAME).1 \ - $DEST_MAN/$(GVIEWNAME).1 \ - $DEST_MAN/$(RGVIMNAME).1 \ - $DEST_MAN/$(RGVIEWNAME).1 \ - $DEST_MAN/$(GVIMDIFFNAME).1 \ - $DEST_MAN/$(EVIEWNAME).1 + $DEST_MAN/$(GVIEWNAME).1 \ + $DEST_MAN/$(RGVIMNAME).1 \ + $DEST_MAN/$(RGVIEWNAME).1 \ + $DEST_MAN/$(GVIMDIFFNAME).1 \ + $DEST_MAN/$(EVIEWNAME).1 $DEST_MAN/$(EXNAME).1: {buildcheck = } :sys cd $DEST_MAN; ln -s $(VIMNAME).1 $(EXNAME).1 @@ -1056,11 +1056,11 @@ uninstall_runtime {virtual}{force}: :del {force} $DEST_AUTO/*.vim $DEST_AUTO/README.txt :del {force} $DEST_PLUG/*.vim $DEST_PLUG/README.txt :deldir {force} $DEST_FTP $DEST_AUTO $DEST_PLUG $DEST_PRINT $DEST_RT -# This will fail when other Vim versions are installed, no worries. +# This will fail when other Vim versions are installed, no worries. @try: - :deldir $DEST_VIM + :deldir $DEST_VIM @except: - :print Cannot delete $DEST_VIM + :print Cannot delete $DEST_VIM # vim: sts=4 sw=4 : diff --git a/src/message.c b/src/message.c index 6daa36550..0a2fe995b 100644 --- a/src/message.c +++ b/src/message.c @@ -3749,6 +3749,7 @@ tv_nr(tvs, idxp) /* * Get string argument from "idxp" entry in "tvs". First entry is 1. + * Returns NULL for an error. */ static char * tv_str(tvs, idxp) diff --git a/src/move.c b/src/move.c index ac59320cf..c8a5a2321 100644 --- a/src/move.c +++ b/src/move.c @@ -20,6 +20,7 @@ #include "vim.h" static void comp_botline __ARGS((win_T *wp)); +static int scrolljump_value __ARGS((void)); static int check_top_offset __ARGS((void)); static void curs_rows __ARGS((win_T *wp, int do_botline)); static void validate_botline_win __ARGS((win_T *wp)); @@ -249,7 +250,7 @@ update_topline() scroll_cursor_halfway(FALSE); else { - scroll_cursor_top((int)p_sj, FALSE); + scroll_cursor_top(scrolljump_value(), FALSE); check_botline = TRUE; } } @@ -341,7 +342,7 @@ update_topline() line_count = curwin->w_cursor.lnum - curwin->w_botline + 1 + p_so; if (line_count <= curwin->w_height + 1) - scroll_cursor_bot((int)p_sj, FALSE); + scroll_cursor_bot(scrolljump_value(), FALSE); else scroll_cursor_halfway(FALSE); } @@ -377,6 +378,19 @@ update_topline() } /* + * Return the scrolljump value to use for the current window. + * When 'scrolljump' is positive use it as-is. + * When 'scrolljump' is negative use it as a percentage of the window height. + */ + static int +scrolljump_value() +{ + if (p_sj >= 0) + return (int)p_sj; + return (curwin->w_height * -p_sj) / 100; +} + +/* * Return TRUE when there are not 'scrolloff' lines above the cursor for the * current window. */ diff --git a/src/option.c b/src/option.c index 96d9df2da..d547edc1e 100644 --- a/src/option.c +++ b/src/option.c @@ -7420,7 +7420,7 @@ set_num_option(opt_idx, varp, value, errbuf, errbuflen, opt_flags) errmsg = e_positive; p_report = 1; } - if ((p_sj < 0 || p_sj >= Rows) && full_screen) + if ((p_sj < -100 || p_sj >= Rows) && full_screen) { if (Rows != old_Rows) /* Rows changed, just adjust p_sj */ p_sj = Rows / 2; diff --git a/src/quickfix.c b/src/quickfix.c index 113318782..e1e0d16e4 100644 --- a/src/quickfix.c +++ b/src/quickfix.c @@ -2215,8 +2215,10 @@ ex_make(eap) { apply_autocmds(EVENT_QUICKFIXCMDPRE, au_name, curbuf->b_fname, TRUE, curbuf); +# ifdef FEAT_EVAL if (did_throw || force_abort) return; +# endif } #endif @@ -2974,6 +2976,7 @@ ex_cbuffer(eap) } } +#if defined(FEAT_EVAL) || defined(PROTO) /* * ":cexpr {expr}" command. */ @@ -2994,6 +2997,7 @@ ex_cexpr(eap) clear_tv(tv); } +#endif /* * ":helpgrep {pattern}" diff --git a/src/spell.c b/src/spell.c index 2562e4b8b..53447afb9 100644 --- a/src/spell.c +++ b/src/spell.c @@ -511,15 +511,15 @@ typedef struct suggest_S #define SCORE_RARE 180 /* rare word */ #define SCORE_SWAP 90 /* swap two characters */ #define SCORE_SWAP3 110 /* swap two characters in three */ -#define SCORE_REP 87 /* REP replacement */ +#define SCORE_REP 65 /* REP replacement */ #define SCORE_SUBST 93 /* substitute a character */ #define SCORE_SIMILAR 33 /* substitute a similar character */ #define SCORE_SUBCOMP 33 /* substitute a composing character */ #define SCORE_DEL 94 /* delete a character */ -#define SCORE_DELDUP 64 /* delete a duplicated character */ +#define SCORE_DELDUP 66 /* delete a duplicated character */ #define SCORE_DELCOMP 28 /* delete a composing character */ #define SCORE_INS 96 /* insert a character */ -#define SCORE_INSDUP 66 /* insert a duplicate character */ +#define SCORE_INSDUP 67 /* insert a duplicate character */ #define SCORE_INSCOMP 30 /* insert a composing character */ #define SCORE_NONWORD 103 /* change non-word to word char */ @@ -5049,7 +5049,17 @@ spell_read_aff(spin, fname) if (itemcnt > 3 && items[3][0] != '#') smsg((char_u *)_(e_afftrailing), fname, lnum, items[3]); if (do_rep) + { + /* Replace underscore with space (can't include a space + * directly). */ + for (p = items[1]; *p != NUL; mb_ptr_adv(p)) + if (*p == '_') + *p = ' '; + for (p = items[2]; *p != NUL; mb_ptr_adv(p)) + if (*p == '_') + *p = ' '; add_fromto(spin, &spin->si_rep, items[1], items[2]); + } } else if (STRCMP(items[0], "MAP") == 0 && itemcnt == 2) { @@ -11081,13 +11091,21 @@ add_suggestion(su, gap, goodword, badlen, score, altscore, had_bonus, slang) int had_bonus; /* value for st_had_bonus */ slang_T *slang; /* language for sound folding */ { + int goodlen = STRLEN(goodword); suggest_T *stp; int i; char_u *p = NULL; int c = 0; + int attr = 0; + char_u longword[MAXWLEN + 1]; - /* Check that the word wasn't banned. */ - if (was_banned(su, goodword)) + /* Check that the word really is valid. Esp. for banned words and for + * split words, such as "the the". Need to append what follows to check + * for that. */ + STRCPY(longword, goodword); + vim_strncpy(longword + goodlen, su->su_badptr + badlen, MAXWLEN - goodlen); + (void)spell_check(curwin, longword, &attr, NULL); + if (attr != 0) return; /* If past "su_badlen" and the rest is identical stop at "su_badlen". @@ -11097,7 +11115,7 @@ add_suggestion(su, gap, goodword, badlen, score, altscore, had_bonus, slang) { /* This assumes there was no case folding or it didn't change the * length... */ - p = goodword + STRLEN(goodword) - i; + p = goodword + goodlen - i; if (p > goodword && STRNICMP(su->su_badptr + su->su_badlen, p, i) == 0) { badlen = su->su_badlen; @@ -11112,7 +11130,7 @@ add_suggestion(su, gap, goodword, badlen, score, altscore, had_bonus, slang) /* When replacing part of the word check that we actually change * something. For "the the" a suggestion can be replacing the first * "the" with itself, since "the" wasn't banned. */ - if (badlen == (int)STRLEN(goodword) + if (badlen == (int)goodlen && STRNCMP(su->su_badword, goodword, badlen) == 0) return; } diff --git a/src/testdir/test59.in b/src/testdir/test59.in index a2dcc8951..e3de1d630 100644 --- a/src/testdir/test59.in +++ b/src/testdir/test59.in @@ -33,7 +33,7 @@ STARTTEST normal 0f:]s let prevbad = '' while 1 - let bad = spellbadword() + let [bad, a] = spellbadword() if bad == '' || bad == prevbad || bad == 'badend' break endif @@ -64,31 +64,31 @@ gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add :mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add :set spellfile=Xtest.utf-8.add /^test2: -]s:let str = spellbadword() +]s:let [str, a] = spellbadword() :$put =str :set spl=Xtest_us.utf-8.spl /^test2: -]smm:let str = spellbadword() +]smm:let [str, a] = spellbadword() :$put =str -`m]s:let str = spellbadword() +`m]s:let [str, a] = spellbadword() :$put =str :set spl=Xtest_gb.utf-8.spl /^test2: -]smm:let str = spellbadword() +]smm:let [str, a] = spellbadword() :$put =str -`m]s:let str = spellbadword() +`m]s:let [str, a] = spellbadword() :$put =str :set spl=Xtest_nz.utf-8.spl /^test2: -]smm:let str = spellbadword() +]smm:let [str, a] = spellbadword() :$put =str -`m]s:let str = spellbadword() +`m]s:let [str, a] = spellbadword() :$put =str :set spl=Xtest_ca.utf-8.spl /^test2: -]smm:let str = spellbadword() +]smm:let [str, a] = spellbadword() :$put =str -`m]s:let str = spellbadword() +`m]s:let [str, a] = spellbadword() :$put =str :" :" Postponed prefixes diff --git a/src/version.h b/src/version.h index 0cb24adae..cf19c79dd 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 20)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 20, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 25)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Sep 25, compiled " |