diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile | 2 | ||||
-rw-r--r-- | src/ex_cmds2.c | 6 | ||||
-rw-r--r-- | src/fileio.c | 16 | ||||
-rw-r--r-- | src/testdir/Make_amiga.mak | 3 | ||||
-rw-r--r-- | src/testdir/Make_dos.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_os2.mak | 2 | ||||
-rw-r--r-- | src/testdir/Make_vms.mms | 4 | ||||
-rw-r--r-- | src/testdir/Makefile | 3 | ||||
-rw-r--r-- | src/testdir/test58.in | 135 | ||||
-rw-r--r-- | src/testdir/test58.ok | 32 | ||||
-rw-r--r-- | src/testdir/test59.in | 406 | ||||
-rw-r--r-- | src/testdir/test59.ok | 74 | ||||
-rw-r--r-- | src/version.h | 4 |
13 files changed, 646 insertions, 43 deletions
diff --git a/src/Makefile b/src/Makefile index 03ee7c28b7..cea05871a8 100644 --- a/src/Makefile +++ b/src/Makefile @@ -516,6 +516,8 @@ CClink = $(CC) # EFENCE - Electric-Fence malloc debugging: catches memory accesses beyond # allocated memory (and makes every malloc()/free() very slow). # Electric Fence is free (search ftp sites). +# You may want to set the EF_PROTECT_BELOW environment variable to check the +# other side of allocated memory. # On FreeBSD you might need to enlarge the number of mmaps allowed. Do this # as root: sysctl -w vm.max_proc_mmap=30000 #EXTRA_LIBS = /usr/local/lib/libefence.a diff --git a/src/ex_cmds2.c b/src/ex_cmds2.c index 0eac58bda0..b3faec86ce 100644 --- a/src/ex_cmds2.c +++ b/src/ex_cmds2.c @@ -1186,9 +1186,9 @@ script_dump_profile(fd) int prof_def_func() { - scriptitem_T *si = &SCRIPT_ITEM(current_SID); - - return si->sn_pr_force; + if (current_SID > 0) + return SCRIPT_ITEM(current_SID).sn_pr_force; + return FALSE; } # endif diff --git a/src/fileio.c b/src/fileio.c index a8192eab07..dc2606b93d 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -5435,25 +5435,27 @@ buf_modname(shortname, fname, ext, prepend_dot) * Then truncate what is after the '/', '\' or ':' to 8 characters for * MSDOS and 26 characters for AMIGA, a lot more for UNIX. */ - for (ptr = retval + fnamelen; ptr >= retval; mb_ptr_back(retval, ptr)) + for (ptr = retval + fnamelen; ptr > retval; mb_ptr_back(retval, ptr)) { #ifndef RISCOS if (*ext == '.' -#ifdef USE_LONG_FNAME +# ifdef USE_LONG_FNAME && (!USE_LONG_FNAME || shortname) -#else -# ifndef SHORT_FNAME +# else +# ifndef SHORT_FNAME && shortname +# endif # endif -#endif ) if (*ptr == '.') /* replace '.' by '_' */ *ptr = '_'; -#endif /* RISCOS */ +#endif if (vim_ispathsep(*ptr)) + { + ++ptr; break; + } } - ptr++; /* the file name has at most BASENAMELEN characters. */ #ifndef SHORT_FNAME diff --git a/src/testdir/Make_amiga.mak b/src/testdir/Make_amiga.mak index 1c9d422e8e..e9e75e517f 100644 --- a/src/testdir/Make_amiga.mak +++ b/src/testdir/Make_amiga.mak @@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ - test56.out test57.out test58.out + test56.out test57.out test58.out test59.out .SUFFIXES: .in .out @@ -102,3 +102,4 @@ test55.out: test55.in test56.out: test56.in test57.out: test57.in test58.out: test58.in +test59.out: test59.in diff --git a/src/testdir/Make_dos.mak b/src/testdir/Make_dos.mak index 1b3c772b46..092b24aaca 100644 --- a/src/testdir/Make_dos.mak +++ b/src/testdir/Make_dos.mak @@ -18,7 +18,7 @@ SCRIPTS16 = test1.out test19.out test20.out test22.out \ test35.out test36.out test43.out \ test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out \ - test55.out test56.out test57.out test58.out + test55.out test56.out test57.out test58.out test59.out SCRIPTS = test3.out test4.out test5.out test6.out test7.out \ test8.out test9.out test11.out test13.out test14.out \ diff --git a/src/testdir/Make_os2.mak b/src/testdir/Make_os2.mak index a771e6a5fc..5236922c5f 100644 --- a/src/testdir/Make_os2.mak +++ b/src/testdir/Make_os2.mak @@ -24,7 +24,7 @@ SCRIPTS = test1.out test3.out test4.out test5.out test6.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ test48.out test51.out test53.out test54.out test55.out \ - test56.out test57.out test58.out + test56.out test57.out test58.out test59.out .SUFFIXES: .in .out diff --git a/src/testdir/Make_vms.mms b/src/testdir/Make_vms.mms index 1ca1e8b1b9..6d08e5041a 100644 --- a/src/testdir/Make_vms.mms +++ b/src/testdir/Make_vms.mms @@ -4,7 +4,7 @@ # Authors: Zoltan Arpadffy, <arpadffy@polarhome.com> # Sandor Kopanyi, <sandor.kopanyi@mailbox.hu> # -# Last change: 2005 Jul 04 +# Last change: 2005 Jul 05 # # This has been tested on VMS 6.2 to 7.2 on DEC Alpha and VAX. # Edit the lines in the Configuration section below to select. @@ -58,7 +58,7 @@ SCRIPT = test1.out test2.out test3.out test4.out test5.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out \ test48.out test51.out test53.out test54.out test55.out \ - test56.out test57.out test58.out + test56.out test57.out test58.out test59.out .IFDEF WANT_GUI SCRIPT_GUI = test16.out diff --git a/src/testdir/Makefile b/src/testdir/Makefile index 7fa325f847..433f487118 100644 --- a/src/testdir/Makefile +++ b/src/testdir/Makefile @@ -14,7 +14,8 @@ SCRIPTS = test1.out test2.out test3.out test4.out test5.out test6.out \ test38.out test39.out test40.out test41.out test42.out \ test43.out test44.out test45.out test46.out test47.out \ test48.out test49.out test51.out test52.out test53.out \ - test54.out test55.out test56.out test57.out test58.out + test54.out test55.out test56.out test57.out test58.out \ + test59.out SCRIPTS_GUI = test16.out diff --git a/src/testdir/test58.in b/src/testdir/test58.in index 58275a3f11..0575a44401 100644 --- a/src/testdir/test58.in +++ b/src/testdir/test58.in @@ -12,31 +12,46 @@ STARTTEST :" use that spell file :set spl=Xtest.latin1.spl :set spell +:func SpellTest() /^test1: -]smm:let str = spellbadword() -:$put =str -`m:let lst = spellsuggest(str, 4) -:$put =string(lst) -`m]smm:let str = spellbadword() -:$put =str -`m:let lst = spellsuggest(str, 2) -:$put =string(lst) -`m]smm:let str = spellbadword() -:$put =str -`m:let lst = spellsuggest(str, 2) -:$put =string(lst) -`m]smm:let str = spellbadword() -:$put =str -`m:let lst = spellsuggest(str, 2) -:$put =string(lst) -`m]smm:let str = spellbadword() -:$put =str -`m:let lst = spellsuggest(str, 2) -:$put =string(lst) -`m]smm:let str = spellbadword() -:$put =str -`m:let lst = spellsuggest(str, 2) -:$put =string(lst) +normal ]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 4) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +endfunc +:call SpellTest() :spelldump 1GyG:q :$put @@ -84,6 +99,17 @@ gg:/^addstart/+1,/^addend/-1w! Xtest.latin1.add `m]s:let str = spellbadword() :$put =str :" +:" Postponed prefixes +gg:/^affstart3/+1,/^affend3/-1w! Xtest.aff +:mkspell! Xtest Xtest +:set spellfile= +:set spl=Xtest.latin1.spl +:mess +:spelldump +1GyG:q +:$put +:call SpellTest() +:" gg:/^test output:/,$wq! test.out ENDTEST @@ -116,6 +142,11 @@ SFX S Y 2 SFX S 0 s [^s] SFX S 0 es s +SFX N N 3 +SFX N 0 en [^n] +SFX N 0 nen n +SFX N 0 n . + REP 3 REP g ch REP ch g @@ -159,6 +190,11 @@ SFX S Y 2 SFX S 0 s [^s] SFX S 0 es s +SFX N N 3 +SFX N 0 en [^n] +SFX N 0 nen n +SFX N 0 n . + REP 3 REP g ch REP ch g @@ -284,9 +320,58 @@ SAL ZZ- _ SAL Z S affend2 +affstart3 +SET ISO8859-1 + +FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + +PFXPOSTPONE + +MIDWORD '- + +KEP = +RAR ? +BAD ! + +NOSPLITSUGS + +PFX I N 1 +PFX I 0 in . + +PFX O Y 1 +PFX O 0 out . + +SFX S Y 2 +SFX S 0 s [^s] +SFX S 0 es s + +SFX N N 3 +SFX N 0 en [^n] +SFX N 0 nen n +SFX N 0 n . + +REP 3 +REP g ch +REP ch g +REP svp s.v.p. + +MAP 9 +MAP aàáâãäå +MAP eèéêë +MAP iìíîï +MAP oòóôõö +MAP uùúûü +MAP nñ +MAP cç +MAP yÿý +MAP sß +affend3 + dicstart 123456 -test +test/NO # comment wrong Comment diff --git a/src/testdir/test58.ok b/src/testdir/test58.ok index 6de84842c9..186b256668 100644 --- a/src/testdir/test58.ok +++ b/src/testdir/test58.ok @@ -19,9 +19,12 @@ input OK output outputs +outtest put puts test +testen +testn the end uk wrong @@ -40,3 +43,32 @@ elequint elekwent elequint elekwint +# file: Xtest.latin1.spl +Comment +deol +déôr +OK +put +input +output +puts +outputs +test +outtest +testen +testn +the end +uk +wrong +inputs +['input', 'puts', 'put', 'outputs'] +comment +['Comment'] +ok +['OK', 'uk'] +Ok +['OK', 'Uk'] +test +['test', 'Test'] +déôl +['deol', 'déôr'] diff --git a/src/testdir/test59.in b/src/testdir/test59.in new file mode 100644 index 0000000000..5a3753068c --- /dev/null +++ b/src/testdir/test59.in @@ -0,0 +1,406 @@ +Tests for spell checking with 'encoding' set to "utf-8". vim: set ft=vim : + +STARTTEST +:so small.vim +:so mbyte.vim +:" +:" First generate a .spl file from a .dic and a .aff file. +:set enc=utf-8 +:/^affstart1/+1,/affend1/-1w Xtest.aff +:/^dicstart/+1,/dicend/-1w Xtest.dic +:mkspell Xtest Xtest +:" +:" use that spell file +:set spl=Xtest.utf-8.spl +:set spell +:func SpellTest() +/^test1: +normal ]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 4) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +normal `m]smm +let str = spellbadword() +$put =str +normal `m +let lst = spellsuggest(str, 2) +$put =string(lst) +endfunc +:call SpellTest() +:spelldump +1GyG:q +:$put +:$put =soundfold('goobledygoook') +:$put =soundfold('kóopërÿnôven') +:$put =soundfold('oeverloos gezwets edale') +:" +:" and now with SAL instead of SOFO items; test automatic reloading +gg:/^affstart2/+1,/^affend2/-1w! Xtest.aff +:mkspell! Xtest Xtest +:$put =soundfold('goobledygoook') +:$put =soundfold('kóopërÿnôven') +:$put =soundfold('oeverloos gezwets edale') +:" +:" also use an addition file +gg:/^addstart/+1,/^addend/-1w! Xtest.utf-8.add +:mkspell! Xtest.utf-8.add.spl Xtest.utf-8.add +:set spl=en +:set spellfile=Xtest.utf-8.add +/^test2: +]s:let str = spellbadword() +:$put =str +:set spl=en_us +/^test2: +]smm:let str = spellbadword() +:$put =str +`m]s:let str = spellbadword() +:$put =str +:set spl=en_gb +/^test2: +]smm:let str = spellbadword() +:$put =str +`m]s:let str = spellbadword() +:$put =str +:set spl=en_nz +/^test2: +]smm:let str = spellbadword() +:$put =str +`m]s:let str = spellbadword() +:$put =str +:set spl=en_ca +/^test2: +]smm:let str = spellbadword() +:$put =str +`m]s:let str = spellbadword() +:$put =str +:" +:" Postponed prefixes +gg:/^affstart3/+1,/^affend3/-1w! Xtest.aff +:mkspell! Xtest Xtest +:set spellfile= +:set spl=Xtest.utf-8.spl +:mess +:spelldump +1GyG:q +:$put +:call SpellTest() +:" +gg:/^test output:/,$wq! test.out +ENDTEST + +affstart1 +SET ISO8859-1 +TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ + +FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + +SOFOFROM abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZàáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞ¿ +SOFOTO ebctefghejklnnepkrstevvkesebctefghejklnnepkrstevvkeseeeeeeeceeeeeeeedneeeeeeeeeeepseeeeeeeeceeeeeeeedneeeeeeeeeeep? + +MIDWORD '- + +KEP = +RAR ? +BAD ! + +NOSPLITSUGS + +PFX I N 1 +PFX I 0 in . + +PFX O Y 1 +PFX O 0 out . + +SFX S Y 2 +SFX S 0 s [^s] +SFX S 0 es s + +SFX N N 3 +SFX N 0 en [^n] +SFX N 0 nen n +SFX N 0 n . + +REP 3 +REP g ch +REP ch g +REP svp s.v.p. + +MAP 9 +MAP aàáâãäå +MAP eèéêë +MAP iìíîï +MAP oòóôõö +MAP uùúûü +MAP nñ +MAP cç +MAP yÿý +MAP sß +affend1 + +affstart2 +SET ISO8859-1 +TRY esianrtolcdugmphbyfvkwjkqxz-ëéèêïîäàâöüû'ESIANRTOLCDUGMPHBYFVKWJKQXZ + +FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + +MIDWORD '- + +KEP = +RAR ? +BAD ! + +NOSPLITSUGS + +PFX I N 1 +PFX I 0 in . + +PFX O Y 1 +PFX O 0 out . + +SFX S Y 2 +SFX S 0 s [^s] +SFX S 0 es s + +SFX N N 3 +SFX N 0 en [^n] +SFX N 0 nen n +SFX N 0 n . + +REP 3 +REP g ch +REP ch g +REP svp s.v.p. + +MAP 9 +MAP aàáâãäå +MAP eèéêë +MAP iìíîï +MAP oòóôõö +MAP uùúûü +MAP nñ +MAP cç +MAP yÿý +MAP sß + +SAL AH(AEIOUY)-^ *H +SAL AR(AEIOUY)-^ *R +SAL A(HR)^ * +SAL A^ * +SAL AH(AEIOUY)- H +SAL AR(AEIOUY)- R +SAL A(HR) _ +SAL À^ * +SAL Å^ * +SAL BB- _ +SAL B B +SAL CQ- _ +SAL CIA X +SAL CH X +SAL C(EIY)- S +SAL CK K +SAL COUGH^ KF +SAL CC< C +SAL C K +SAL DG(EIY) K +SAL DD- _ +SAL D T +SAL É< E +SAL EH(AEIOUY)-^ *H +SAL ER(AEIOUY)-^ *R +SAL E(HR)^ * +SAL ENOUGH^$ *NF +SAL E^ * +SAL EH(AEIOUY)- H +SAL ER(AEIOUY)- R +SAL E(HR) _ +SAL FF- _ +SAL F F +SAL GN^ N +SAL GN$ N +SAL GNS$ NS +SAL GNED$ N +SAL GH(AEIOUY)- K +SAL GH _ +SAL GG9 K +SAL G K +SAL H H +SAL IH(AEIOUY)-^ *H +SAL IR(AEIOUY)-^ *R +SAL I(HR)^ * +SAL I^ * +SAL ING6 N +SAL IH(AEIOUY)- H +SAL IR(AEIOUY)- R +SAL I(HR) _ +SAL J K +SAL KN^ N +SAL KK- _ +SAL K K +SAL LAUGH^ LF +SAL LL- _ +SAL L L +SAL MB$ M +SAL MM M +SAL M M +SAL NN- _ +SAL N N +SAL OH(AEIOUY)-^ *H +SAL OR(AEIOUY)-^ *R +SAL O(HR)^ * +SAL O^ * +SAL OH(AEIOUY)- H +SAL OR(AEIOUY)- R +SAL O(HR) _ +SAL PH F +SAL PN^ N +SAL PP- _ +SAL P P +SAL Q K +SAL RH^ R +SAL ROUGH^ RF +SAL RR- _ +SAL R R +SAL SCH(EOU)- SK +SAL SC(IEY)- S +SAL SH X +SAL SI(AO)- X +SAL SS- _ +SAL S S +SAL TI(AO)- X +SAL TH @ +SAL TCH-- _ +SAL TOUGH^ TF +SAL TT- _ +SAL T T +SAL UH(AEIOUY)-^ *H +SAL UR(AEIOUY)-^ *R +SAL U(HR)^ * +SAL U^ * +SAL UH(AEIOUY)- H +SAL UR(AEIOUY)- R +SAL U(HR) _ +SAL V^ W +SAL V F +SAL WR^ R +SAL WH^ W +SAL W(AEIOU)- W +SAL X^ S +SAL X KS +SAL Y(AEIOU)- Y +SAL ZZ- _ +SAL Z S +affend2 + +affstart3 +SET ISO8859-1 + +FOL àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +LOW àáâãäåæçèéêëìíîïðñòóôõöøùúûüýþßÿ +UPP ÀÁÂÃÄÅÆÇÈÉÊËÌÍÎÏÐÑÒÓÔÕÖØÙÚÛÜÝÞßÿ + +PFXPOSTPONE + +MIDWORD '- + +KEP = +RAR ? +BAD ! + +NOSPLITSUGS + +PFX I N 1 +PFX I 0 in . + +PFX O Y 1 +PFX O 0 out . + +SFX S Y 2 +SFX S 0 s [^s] +SFX S 0 es s + +SFX N N 3 +SFX N 0 en [^n] +SFX N 0 nen n +SFX N 0 n . + +REP 3 +REP g ch +REP ch g +REP svp s.v.p. + +MAP 9 +MAP aàáâãäå +MAP eèéêë +MAP iìíîï +MAP oòóôõö +MAP uùúûü +MAP nñ +MAP cç +MAP yÿý +MAP sß +affend3 + +dicstart +123456 +test/NO +# comment +wrong +Comment +OK +uk +put/ISO +the end +deol +déôr +dicend + +addstart +/regions=usgbnz +elequint/2 +elekwint/3 +addend + +test1: +inputs wrong +comment wrong +puts OK +ok wrong +Ok wrong +the end. test wrong +déôl + +test2: +elequint test elekwint test elekwent asdf + + +test output: diff --git a/src/testdir/test59.ok b/src/testdir/test59.ok new file mode 100644 index 0000000000..6bbed6e225 --- /dev/null +++ b/src/testdir/test59.ok @@ -0,0 +1,74 @@ +test output: +inputs +['input', 'puts', 'outputs', 'put'] +comment +['Comment'] +ok +['OK', 'uk'] +Ok +['OK', 'Uk'] +test +['test', 'Test'] +déôl +['deol', 'déôr'] +# file: Xtest.utf-8.spl +Comment +deol +déôr +input +OK +output +outputs +outtest +put +puts +test +testen +testn +the end +uk +wrong +gebletegek +kepereneven +everles gesvets etele +kbltykk +kprnfn +*fls kswts tl +elekwent +elequint +elekwint +elekwint +elekwent +elequint +elekwent +elequint +elekwint +# file: Xtest.utf-8.spl +Comment +deol +déôr +OK +put +input +output +puts +outputs +test +outtest +testen +testn +the end +uk +wrong +inputs +['input', 'puts', 'put', 'outputs'] +comment +['Comment'] +ok +['OK', 'uk'] +Ok +['OK', 'Uk'] +test +['test', 'Test'] +déôl +['deol', 'déôr'] diff --git a/src/version.h b/src/version.h index 9656b5a8f3..5936c4e5a8 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 Jul 4)" -#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 4, compiled " +#define VIM_VERSION_LONG "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 5)" +#define VIM_VERSION_LONG_DATE "VIM - Vi IMproved 7.0aa ALPHA (2005 Jul 5, compiled " |