comparison src/search.c @ 835:8bebcabccc2c v7.0e01

updated for version 7.0e01
author vimboss
date Mon, 17 Apr 2006 22:14:47 +0000
parents dc8197342755
children a5677b7ce858
comparison
equal deleted inserted replaced
834:5117153003bd 835:8bebcabccc2c
907 907
908 /* A pattern like "\n\zs" may go past the last line. */ 908 /* A pattern like "\n\zs" may go past the last line. */
909 if (pos->lnum > buf->b_ml.ml_line_count) 909 if (pos->lnum > buf->b_ml.ml_line_count)
910 { 910 {
911 pos->lnum = buf->b_ml.ml_line_count; 911 pos->lnum = buf->b_ml.ml_line_count;
912 pos->col = STRLEN(ml_get_buf(buf, pos->lnum, FALSE)); 912 pos->col = (int)STRLEN(ml_get_buf(buf, pos->lnum, FALSE));
913 if (pos->col > 0) 913 if (pos->col > 0)
914 --pos->col; 914 --pos->col;
915 } 915 }
916 916
917 return submatch + 1; 917 return submatch + 1;
1073 ps = strcopy; 1073 ps = strcopy;
1074 p = skip_regexp(pat, dirc, (int)p_magic, &strcopy); 1074 p = skip_regexp(pat, dirc, (int)p_magic, &strcopy);
1075 if (strcopy != ps) 1075 if (strcopy != ps)
1076 { 1076 {
1077 /* made a copy of "pat" to change "\?" to "?" */ 1077 /* made a copy of "pat" to change "\?" to "?" */
1078 searchcmdlen += STRLEN(pat) - STRLEN(strcopy); 1078 searchcmdlen += (int)(STRLEN(pat) - STRLEN(strcopy));
1079 pat = strcopy; 1079 pat = strcopy;
1080 searchstr = strcopy; 1080 searchstr = strcopy;
1081 } 1081 }
1082 if (*p == dirc) 1082 if (*p == dirc)
1083 { 1083 {
3658 if (*p != '<') 3658 if (*p != '<')
3659 return FALSE; 3659 return FALSE;
3660 } 3660 }
3661 3661
3662 pos.lnum = curwin->w_cursor.lnum; 3662 pos.lnum = curwin->w_cursor.lnum;
3663 pos.col = p - line; 3663 pos.col = (colnr_T)(p - line);
3664 3664
3665 mb_ptr_adv(p); 3665 mb_ptr_adv(p);
3666 if (end_tag) 3666 if (end_tag)
3667 /* check that there is a '/' after the '<' */ 3667 /* check that there is a '/' after the '<' */
3668 return *p == '/'; 3668 return *p == '/';
3778 */ 3778 */
3779 inc_cursor(); 3779 inc_cursor();
3780 p = ml_get_cursor(); 3780 p = ml_get_cursor();
3781 for (cp = p; *cp != NUL && *cp != '>' && !vim_iswhite(*cp); mb_ptr_adv(cp)) 3781 for (cp = p; *cp != NUL && *cp != '>' && !vim_iswhite(*cp); mb_ptr_adv(cp))
3782 ; 3782 ;
3783 len = cp - p; 3783 len = (int)(cp - p);
3784 if (len == 0) 3784 if (len == 0)
3785 { 3785 {
3786 curwin->w_cursor = old_pos; 3786 curwin->w_cursor = old_pos;
3787 goto theend; 3787 goto theend;
3788 } 3788 }
4525 ? curbuf->b_ffname : curr_fname; 4525 ? curbuf->b_ffname : curr_fname;
4526 4526
4527 if (inc_opt != NULL && strstr((char *)inc_opt, "\\zs") != NULL) 4527 if (inc_opt != NULL && strstr((char *)inc_opt, "\\zs") != NULL)
4528 /* Use text from '\zs' to '\ze' (or end) of 'include'. */ 4528 /* Use text from '\zs' to '\ze' (or end) of 'include'. */
4529 new_fname = find_file_name_in_path(incl_regmatch.startp[0], 4529 new_fname = find_file_name_in_path(incl_regmatch.startp[0],
4530 incl_regmatch.endp[0] - incl_regmatch.startp[0], 4530 (int)(incl_regmatch.endp[0] - incl_regmatch.startp[0]),
4531 FNAME_EXP|FNAME_INCL|FNAME_REL, 1L, p_fname); 4531 FNAME_EXP|FNAME_INCL|FNAME_REL, 1L, p_fname);
4532 else 4532 else
4533 /* Use text after match with 'include'. */ 4533 /* Use text after match with 'include'. */
4534 new_fname = file_name_in_line(incl_regmatch.endp[0], 0, 4534 new_fname = file_name_in_line(incl_regmatch.endp[0], 0,
4535 FNAME_EXP|FNAME_INCL|FNAME_REL, 1L, p_fname, NULL); 4535 FNAME_EXP|FNAME_INCL|FNAME_REL, 1L, p_fname, NULL);
4611 ; 4611 ;
4612 if (i == 0) 4612 if (i == 0)
4613 { 4613 {
4614 /* Nothing found, use the rest of the line. */ 4614 /* Nothing found, use the rest of the line. */
4615 p = incl_regmatch.endp[0]; 4615 p = incl_regmatch.endp[0];
4616 i = STRLEN(p); 4616 i = (int)STRLEN(p);
4617 } 4617 }
4618 else 4618 else
4619 { 4619 {
4620 if (p[-1] == '"' || p[-1] == '<') 4620 if (p[-1] == '"' || p[-1] == '<')
4621 { 4621 {
5268 char *s; /* search pat */ 5268 char *s; /* search pat */
5269 int sc; /* dir char */ 5269 int sc; /* dir char */
5270 { 5270 {
5271 if (spats[idx].pat != NULL) 5271 if (spats[idx].pat != NULL)
5272 { 5272 {
5273 fprintf(fp, "\n# Last %sSearch Pattern:\n~", s); 5273 fprintf(fp, _("\n# Last %sSearch Pattern:\n~"), s);
5274 /* off.dir is not stored, it's reset to forward */ 5274 /* off.dir is not stored, it's reset to forward */
5275 fprintf(fp, "%c%c%c%c%ld%s%c", 5275 fprintf(fp, "%c%c%c%c%ld%s%c",
5276 spats[idx].magic ? 'M' : 'm', /* magic */ 5276 spats[idx].magic ? 'M' : 'm', /* magic */
5277 spats[idx].no_scs ? 's' : 'S', /* smartcase */ 5277 spats[idx].no_scs ? 's' : 'S', /* smartcase */
5278 spats[idx].off.line ? 'L' : 'l', /* line offset */ 5278 spats[idx].off.line ? 'L' : 'l', /* line offset */