Mercurial > vim
comparison src/screen.c @ 685:d7e33248b9c8 v7.0206
updated for version 7.0206
author | vimboss |
---|---|
date | Fri, 24 Feb 2006 23:53:04 +0000 |
parents | 9364d114ed8d |
children | bcd2edc4539e |
comparison
equal
deleted
inserted
replaced
684:a8caf7dd853d | 685:d7e33248b9c8 |
---|---|
5342 #endif | 5342 #endif |
5343 else | 5343 else |
5344 { | 5344 { |
5345 fillchar = fillchar_status(&attr, wp == curwin); | 5345 fillchar = fillchar_status(&attr, wp == curwin); |
5346 | 5346 |
5347 if (buf_spname(wp->w_buffer) != NULL) | 5347 get_trans_bufname(wp->w_buffer); |
5348 STRCPY(NameBuff, buf_spname(wp->w_buffer)); | |
5349 else | |
5350 home_replace(wp->w_buffer, wp->w_buffer->b_fname, NameBuff, | |
5351 MAXPATHL, TRUE); | |
5352 trans_characters(NameBuff, MAXPATHL); | |
5353 p = NameBuff; | 5348 p = NameBuff; |
5354 len = (int)STRLEN(p); | 5349 len = (int)STRLEN(p); |
5355 | 5350 |
5356 if (wp->w_buffer->b_help | 5351 if (wp->w_buffer->b_help |
5357 #ifdef FEAT_QUICKFIX | 5352 #ifdef FEAT_QUICKFIX |
6168 */ | 6163 */ |
6169 if (shl->lnum == 0) | 6164 if (shl->lnum == 0) |
6170 matchcol = 0; | 6165 matchcol = 0; |
6171 else if (vim_strchr(p_cpo, CPO_SEARCH) == NULL | 6166 else if (vim_strchr(p_cpo, CPO_SEARCH) == NULL |
6172 || (shl->rm.endpos[0].lnum == 0 | 6167 || (shl->rm.endpos[0].lnum == 0 |
6173 && shl->rm.endpos[0].col == shl->rm.startpos[0].col)) | 6168 && shl->rm.endpos[0].col <= shl->rm.startpos[0].col)) |
6174 { | 6169 { |
6175 matchcol = shl->rm.startpos[0].col + 1; | 6170 char_u *ml = ml_get_buf(shl->buf, lnum, FALSE); |
6176 if (ml_get_buf(shl->buf, lnum, FALSE)[matchcol - 1] == NUL) | 6171 |
6177 { | 6172 matchcol = shl->rm.startpos[0].col; |
6173 ml += matchcol; | |
6174 if (*ml == NUL) | |
6175 { | |
6176 ++matchcol; | |
6178 shl->lnum = 0; | 6177 shl->lnum = 0; |
6179 break; | 6178 break; |
6180 } | 6179 } |
6180 #ifdef FEAT_MBYTE | |
6181 if (has_mbyte) | |
6182 matchcol += mb_ptr2len(ml); | |
6183 else | |
6184 #endif | |
6185 ++matchcol; | |
6181 } | 6186 } |
6182 else | 6187 else |
6183 matchcol = shl->rm.endpos[0].col; | 6188 matchcol = shl->rm.endpos[0].col; |
6184 | 6189 |
6185 shl->lnum = lnum; | 6190 shl->lnum = lnum; |
8575 #endif | 8580 #endif |
8576 ); | 8581 ); |
8577 | 8582 |
8578 redraw_tabline = FALSE; | 8583 redraw_tabline = FALSE; |
8579 | 8584 |
8580 if (tabpageline_height() < 1) | 8585 #ifdef FEAT_GUI_TABLINE |
8586 /* When the GUI has the tabline then this always returns zero. */ | |
8587 if (gui_use_tabline()) | |
8588 { | |
8589 gui_update_tabline(); | |
8590 return; | |
8591 } | |
8592 #endif | |
8593 | |
8594 if (tabline_height() < 1) | |
8581 return; | 8595 return; |
8582 | 8596 |
8583 #if defined(FEAT_STL_OPT) | 8597 #if defined(FEAT_STL_OPT) |
8584 | 8598 |
8585 /* Init TabPageIdxs[] to zero: Clicking outside of tabs has no effect. */ | 8599 /* Init TabPageIdxs[] to zero: Clicking outside of tabs has no effect. */ |
8668 } | 8682 } |
8669 | 8683 |
8670 room = scol - col + tabwidth - 1; | 8684 room = scol - col + tabwidth - 1; |
8671 if (room > 0) | 8685 if (room > 0) |
8672 { | 8686 { |
8673 if (buf_spname(cwp->w_buffer) != NULL) | 8687 /* Get buffer name in NameBuff[] */ |
8674 STRCPY(NameBuff, buf_spname(cwp->w_buffer)); | 8688 get_trans_bufname(cwp->w_buffer); |
8675 else | |
8676 home_replace(cwp->w_buffer, cwp->w_buffer->b_fname, NameBuff, | |
8677 MAXPATHL, TRUE); | |
8678 trans_characters(NameBuff, MAXPATHL); | |
8679 len = vim_strsize(NameBuff); | 8689 len = vim_strsize(NameBuff); |
8680 p = NameBuff; | 8690 p = NameBuff; |
8681 #ifdef FEAT_MBYTE | 8691 #ifdef FEAT_MBYTE |
8682 if (has_mbyte) | 8692 if (has_mbyte) |
8683 while (len > room) | 8693 while (len > room) |
8716 { | 8726 { |
8717 screen_putchar('X', 0, (int)Columns - 1, attr_nosel); | 8727 screen_putchar('X', 0, (int)Columns - 1, attr_nosel); |
8718 TabPageIdxs[Columns - 1] = -999; | 8728 TabPageIdxs[Columns - 1] = -999; |
8719 } | 8729 } |
8720 } | 8730 } |
8731 } | |
8732 | |
8733 /* | |
8734 * Get buffer name for "buf" into NameBuff[]. | |
8735 * Takes care of special buffer names and translates special characters. | |
8736 */ | |
8737 void | |
8738 get_trans_bufname(buf) | |
8739 buf_T *buf; | |
8740 { | |
8741 if (buf_spname(buf) != NULL) | |
8742 STRCPY(NameBuff, buf_spname(buf)); | |
8743 else | |
8744 home_replace(buf, buf->b_fname, NameBuff, MAXPATHL, TRUE); | |
8745 trans_characters(NameBuff, MAXPATHL); | |
8721 } | 8746 } |
8722 #endif | 8747 #endif |
8723 | 8748 |
8724 #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) | 8749 #if defined(FEAT_WINDOWS) || defined(FEAT_WILDMENU) || defined(FEAT_STL_OPT) |
8725 /* | 8750 /* |