Mercurial > vim
comparison src/misc2.c @ 1993:4869457735a9 v7.2.290
updated for version 7.2-290
author | vimboss |
---|---|
date | Wed, 11 Nov 2009 15:56:10 +0000 |
parents | b1b09b68d706 |
children | c5a806b29372 |
comparison
equal
deleted
inserted
replaced
1992:ada3271481ce | 1993:4869457735a9 |
---|---|
1003 # endif | 1003 # endif |
1004 | 1004 |
1005 # ifdef FEAT_MENU | 1005 # ifdef FEAT_MENU |
1006 /* Clear menus. */ | 1006 /* Clear menus. */ |
1007 do_cmdline_cmd((char_u *)"aunmenu *"); | 1007 do_cmdline_cmd((char_u *)"aunmenu *"); |
1008 # ifdef FEAT_MULTI_LANG | |
1009 do_cmdline_cmd((char_u *)"menutranslate clear"); | |
1010 # endif | |
1008 # endif | 1011 # endif |
1009 | 1012 |
1010 /* Clear mappings, abbreviations, breakpoints. */ | 1013 /* Clear mappings, abbreviations, breakpoints. */ |
1014 do_cmdline_cmd((char_u *)"lmapclear"); | |
1015 do_cmdline_cmd((char_u *)"xmapclear"); | |
1011 do_cmdline_cmd((char_u *)"mapclear"); | 1016 do_cmdline_cmd((char_u *)"mapclear"); |
1012 do_cmdline_cmd((char_u *)"mapclear!"); | 1017 do_cmdline_cmd((char_u *)"mapclear!"); |
1013 do_cmdline_cmd((char_u *)"abclear"); | 1018 do_cmdline_cmd((char_u *)"abclear"); |
1014 # if defined(FEAT_EVAL) | 1019 # if defined(FEAT_EVAL) |
1015 do_cmdline_cmd((char_u *)"breakdel *"); | 1020 do_cmdline_cmd((char_u *)"breakdel *"); |
1280 return (strstr((char *)gettail(p_sh), "csh") != NULL); | 1285 return (strstr((char *)gettail(p_sh), "csh") != NULL); |
1281 } | 1286 } |
1282 | 1287 |
1283 /* | 1288 /* |
1284 * Escape "string" for use as a shell argument with system(). | 1289 * Escape "string" for use as a shell argument with system(). |
1285 * This uses single quotes, except when we know we need to use double qoutes | 1290 * This uses single quotes, except when we know we need to use double quotes |
1286 * (MS-DOS and MS-Windows without 'shellslash' set). | 1291 * (MS-DOS and MS-Windows without 'shellslash' set). |
1287 * Escape a newline, depending on the 'shell' option. | 1292 * Escape a newline, depending on the 'shell' option. |
1288 * When "do_special" is TRUE also replace "!", "%", "#" and things starting | 1293 * When "do_special" is TRUE also replace "!", "%", "#" and things starting |
1289 * with "<" like "<cfile>". | 1294 * with "<" like "<cfile>". |
1290 * Returns the result in allocated memory, NULL if we have run out. | 1295 * Returns the result in allocated memory, NULL if we have run out. |
1535 } | 1540 } |
1536 | 1541 |
1537 #if defined(FEAT_VISUALEXTRA) || defined(PROTO) | 1542 #if defined(FEAT_VISUALEXTRA) || defined(PROTO) |
1538 /* | 1543 /* |
1539 * Copy a character a number of times. | 1544 * Copy a character a number of times. |
1540 * Does not work for multi-byte charactes! | 1545 * Does not work for multi-byte characters! |
1541 */ | 1546 */ |
1542 void | 1547 void |
1543 copy_chars(ptr, count, c) | 1548 copy_chars(ptr, count, c) |
1544 char_u *ptr; | 1549 char_u *ptr; |
1545 size_t count; | 1550 size_t count; |
4258 * The octet after a '**' is used as a (binary) counter. | 4263 * The octet after a '**' is used as a (binary) counter. |
4259 * So '**3' is transposed to '**^C' ('^C' is ASCII value 3) | 4264 * So '**3' is transposed to '**^C' ('^C' is ASCII value 3) |
4260 * or '**76' is transposed to '**N'( 'N' is ASCII value 76). | 4265 * or '**76' is transposed to '**N'( 'N' is ASCII value 76). |
4261 * For EBCDIC you get different character values. | 4266 * For EBCDIC you get different character values. |
4262 * If no restrict is given after '**' the default is used. | 4267 * If no restrict is given after '**' the default is used. |
4263 * Due to this technic the path looks awful if you print it as a | 4268 * Due to this technique the path looks awful if you print it as a |
4264 * string. | 4269 * string. |
4265 */ | 4270 */ |
4266 len = 0; | 4271 len = 0; |
4267 while (*wc_part != NUL) | 4272 while (*wc_part != NUL) |
4268 { | 4273 { |
4647 { | 4652 { |
4648 if (!path_with_url(stackp->ffs_filearray[i]) | 4653 if (!path_with_url(stackp->ffs_filearray[i]) |
4649 && !mch_isdir(stackp->ffs_filearray[i])) | 4654 && !mch_isdir(stackp->ffs_filearray[i])) |
4650 continue; /* not a directory */ | 4655 continue; /* not a directory */ |
4651 | 4656 |
4652 /* prepare the filename to be checked for existance | 4657 /* prepare the filename to be checked for existence |
4653 * below */ | 4658 * below */ |
4654 STRCPY(file_path, stackp->ffs_filearray[i]); | 4659 STRCPY(file_path, stackp->ffs_filearray[i]); |
4655 add_pathsep(file_path); | 4660 add_pathsep(file_path); |
4656 STRCAT(file_path, search_ctx->ffsc_file_to_search); | 4661 STRCAT(file_path, search_ctx->ffsc_file_to_search); |
4657 | 4662 |
5436 /* "..", "../path", "." and "./path": don't use the path_option */ | 5441 /* "..", "../path", "." and "./path": don't use the path_option */ |
5437 || rel_to_curdir | 5442 || rel_to_curdir |
5438 #if defined(MSWIN) || defined(MSDOS) || defined(OS2) | 5443 #if defined(MSWIN) || defined(MSDOS) || defined(OS2) |
5439 /* handle "\tmp" as absolute path */ | 5444 /* handle "\tmp" as absolute path */ |
5440 || vim_ispathsep(ff_file_to_find[0]) | 5445 || vim_ispathsep(ff_file_to_find[0]) |
5441 /* handle "c:name" as absulute path */ | 5446 /* handle "c:name" as absolute path */ |
5442 || (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':') | 5447 || (ff_file_to_find[0] != NUL && ff_file_to_find[1] == ':') |
5443 #endif | 5448 #endif |
5444 #ifdef AMIGA | 5449 #ifdef AMIGA |
5445 /* handle ":tmp" as absolute path */ | 5450 /* handle ":tmp" as absolute path */ |
5446 || ff_file_to_find[0] == ':' | 5451 || ff_file_to_find[0] == ':' |
5679 /* Compare the elements. */ | 5684 /* Compare the elements. */ |
5680 p1 = (char_u *)base + j * elm_size; | 5685 p1 = (char_u *)base + j * elm_size; |
5681 p2 = (char_u *)base + (j + gap) * elm_size; | 5686 p2 = (char_u *)base + (j + gap) * elm_size; |
5682 if ((*cmp)((void *)p1, (void *)p2) <= 0) | 5687 if ((*cmp)((void *)p1, (void *)p2) <= 0) |
5683 break; | 5688 break; |
5684 /* Exchange the elemets. */ | 5689 /* Exchange the elements. */ |
5685 mch_memmove(buf, p1, elm_size); | 5690 mch_memmove(buf, p1, elm_size); |
5686 mch_memmove(p1, p2, elm_size); | 5691 mch_memmove(p1, p2, elm_size); |
5687 mch_memmove(p2, buf, elm_size); | 5692 mch_memmove(p2, buf, elm_size); |
5688 } | 5693 } |
5689 | 5694 |