Mercurial > vim
comparison src/gui.c @ 819:23f82b5d2814 v7.0c10
updated for version 7.0c10
author | vimboss |
---|---|
date | Wed, 05 Apr 2006 20:41:53 +0000 |
parents | d2c169a725c8 |
children | 8dd456c1e283 |
comparison
equal
deleted
inserted
replaced
818:1f929f3ca806 | 819:23f82b5d2814 |
---|---|
333 */ | 333 */ |
334 #if defined(SYS_MENU_FILE) && defined(FEAT_MENU) | 334 #if defined(SYS_MENU_FILE) && defined(FEAT_MENU) |
335 if (vim_strchr(p_go, GO_NOSYSMENU) == NULL) | 335 if (vim_strchr(p_go, GO_NOSYSMENU) == NULL) |
336 { | 336 { |
337 sys_menu = TRUE; | 337 sys_menu = TRUE; |
338 do_source((char_u *)SYS_MENU_FILE, FALSE, FALSE); | 338 do_source((char_u *)SYS_MENU_FILE, FALSE, DOSO_NONE); |
339 sys_menu = FALSE; | 339 sys_menu = FALSE; |
340 } | 340 } |
341 #endif | 341 #endif |
342 | 342 |
343 /* | 343 /* |
354 */ | 354 */ |
355 if (use_gvimrc != NULL) | 355 if (use_gvimrc != NULL) |
356 { | 356 { |
357 if (STRCMP(use_gvimrc, "NONE") != 0 | 357 if (STRCMP(use_gvimrc, "NONE") != 0 |
358 && STRCMP(use_gvimrc, "NORC") != 0 | 358 && STRCMP(use_gvimrc, "NORC") != 0 |
359 && do_source(use_gvimrc, FALSE, FALSE) != OK) | 359 && do_source(use_gvimrc, FALSE, DOSO_NONE) != OK) |
360 EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc); | 360 EMSG2(_("E230: Cannot read from \"%s\""), use_gvimrc); |
361 } | 361 } |
362 else | 362 else |
363 { | 363 { |
364 /* | 364 /* |
365 * Get system wide defaults for gvim, only when file name defined. | 365 * Get system wide defaults for gvim, only when file name defined. |
366 */ | 366 */ |
367 #ifdef SYS_GVIMRC_FILE | 367 #ifdef SYS_GVIMRC_FILE |
368 do_source((char_u *)SYS_GVIMRC_FILE, FALSE, FALSE); | 368 do_source((char_u *)SYS_GVIMRC_FILE, FALSE, DOSO_NONE); |
369 #endif | 369 #endif |
370 | 370 |
371 /* | 371 /* |
372 * Try to read GUI initialization commands from the following | 372 * Try to read GUI initialization commands from the following |
373 * places: | 373 * places: |
376 * - the second user gvimrc file ($VIM/.gvimrc for Dos) | 376 * - the second user gvimrc file ($VIM/.gvimrc for Dos) |
377 * - the third user gvimrc file ($VIM/.gvimrc for Amiga) | 377 * - the third user gvimrc file ($VIM/.gvimrc for Amiga) |
378 * The first that exists is used, the rest is ignored. | 378 * The first that exists is used, the rest is ignored. |
379 */ | 379 */ |
380 if (process_env((char_u *)"GVIMINIT", FALSE) == FAIL | 380 if (process_env((char_u *)"GVIMINIT", FALSE) == FAIL |
381 && do_source((char_u *)USR_GVIMRC_FILE, TRUE, TRUE) == FAIL | 381 && do_source((char_u *)USR_GVIMRC_FILE, TRUE, |
382 DOSO_GVIMRC) == FAIL | |
382 #ifdef USR_GVIMRC_FILE2 | 383 #ifdef USR_GVIMRC_FILE2 |
383 && do_source((char_u *)USR_GVIMRC_FILE2, TRUE, TRUE) == FAIL | 384 && do_source((char_u *)USR_GVIMRC_FILE2, TRUE, |
385 DOSO_GVIMRC) == FAIL | |
384 #endif | 386 #endif |
385 ) | 387 ) |
386 { | 388 { |
387 #ifdef USR_GVIMRC_FILE3 | 389 #ifdef USR_GVIMRC_FILE3 |
388 (void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, TRUE); | 390 (void)do_source((char_u *)USR_GVIMRC_FILE3, TRUE, DOSO_GVIMRC); |
389 #endif | 391 #endif |
390 } | 392 } |
391 | 393 |
392 /* | 394 /* |
393 * Read initialization commands from ".gvimrc" in current | 395 * Read initialization commands from ".gvimrc" in current |
427 #ifdef USR_GVIMRC_FILE3 | 429 #ifdef USR_GVIMRC_FILE3 |
428 && fullpathcmp((char_u *)USR_GVIMRC_FILE3, | 430 && fullpathcmp((char_u *)USR_GVIMRC_FILE3, |
429 (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME | 431 (char_u *)GVIMRC_FILE, FALSE) != FPC_SAME |
430 #endif | 432 #endif |
431 ) | 433 ) |
432 do_source((char_u *)GVIMRC_FILE, TRUE, TRUE); | 434 do_source((char_u *)GVIMRC_FILE, TRUE, DOSO_GVIMRC); |
433 | 435 |
434 if (secure == 2) | 436 if (secure == 2) |
435 need_wait_return = TRUE; | 437 need_wait_return = TRUE; |
436 secure = 0; | 438 secure = 0; |
437 } | 439 } |
1140 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_MSWIN) | 1142 #if defined(FEAT_TOOLBAR) && defined(FEAT_GUI_MSWIN) |
1141 if (vim_strchr(p_go, GO_TOOLBAR) != NULL) | 1143 if (vim_strchr(p_go, GO_TOOLBAR) != NULL) |
1142 text_area_y = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT; | 1144 text_area_y = TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT; |
1143 #endif | 1145 #endif |
1144 | 1146 |
1145 #if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) | 1147 # if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \ |
1148 || defined(FEAT_GUI_MOTIF)) | |
1146 if (gui_has_tabline()) | 1149 if (gui_has_tabline()) |
1147 text_area_y += TABLINE_HEIGHT; | 1150 text_area_y += TABLINE_HEIGHT; |
1148 #endif | 1151 #endif |
1149 | 1152 |
1150 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) | 1153 #if defined(FEAT_TOOLBAR) && (defined(FEAT_GUI_MOTIF) || defined(FEAT_GUI_ATHENA)) |
1226 base_height += (TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT); | 1229 base_height += (TOOLBAR_BUTTON_HEIGHT + TOOLBAR_BORDER_HEIGHT); |
1227 # else | 1230 # else |
1228 base_height += gui.toolbar_height; | 1231 base_height += gui.toolbar_height; |
1229 # endif | 1232 # endif |
1230 # endif | 1233 # endif |
1231 # if defined(FEAT_GUI_TABLINE) && defined(FEAT_GUI_MSWIN) | 1234 # if defined(FEAT_GUI_TABLINE) && (defined(FEAT_GUI_MSWIN) \ |
1235 || defined(FEAT_GUI_MOTIF)) | |
1232 if (gui_has_tabline()) | 1236 if (gui_has_tabline()) |
1233 base_height += TABLINE_HEIGHT; | 1237 base_height += TABLINE_HEIGHT; |
1234 # endif | 1238 # endif |
1235 # ifdef FEAT_FOOTER | 1239 # ifdef FEAT_FOOTER |
1236 if (vim_strchr(p_go, GO_FOOTER) != NULL) | 1240 if (vim_strchr(p_go, GO_FOOTER) != NULL) |
1237 base_height += gui.footer_height; | 1241 base_height += gui.footer_height; |
1238 # endif | 1242 # endif |
3446 (char_u *)"", OPT_FREE, SID_ERROR); | 3450 (char_u *)"", OPT_FREE, SID_ERROR); |
3447 called_emsg |= save_called_emsg; | 3451 called_emsg |= save_called_emsg; |
3448 } | 3452 } |
3449 else | 3453 else |
3450 { | 3454 { |
3451 /* Get the buffer name into NameBuff[] */ | 3455 /* Get the buffer name into NameBuff[] and shorten it. */ |
3452 get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer); | 3456 get_trans_bufname(tp == curtab ? curbuf : tp->tp_curwin->w_buffer); |
3457 shorten_dir(NameBuff); | |
3453 | 3458 |
3454 wp = (tp == curtab) ? firstwin : tp->tp_firstwin; | 3459 wp = (tp == curtab) ? firstwin : tp->tp_firstwin; |
3455 for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) | 3460 for (wincount = 0; wp != NULL; wp = wp->w_next, ++wincount) |
3456 if (bufIsChanged(wp->w_buffer)) | 3461 if (bufIsChanged(wp->w_buffer)) |
3457 modified = TRUE; | 3462 modified = TRUE; |
4569 } | 4574 } |
4570 else if (row > wp->w_height) /* below status line */ | 4575 else if (row > wp->w_height) /* below status line */ |
4571 update_mouseshape(SHAPE_IDX_CLINE); | 4576 update_mouseshape(SHAPE_IDX_CLINE); |
4572 # ifdef FEAT_VERTSPLIT | 4577 # ifdef FEAT_VERTSPLIT |
4573 else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width | 4578 else if (!(State & CMDLINE) && W_VSEP_WIDTH(wp) > 0 && col == wp->w_width |
4574 && (row != wp->w_height || !stl_connected(wp))) | 4579 && (row != wp->w_height || !stl_connected(wp)) && msg_scrolled == 0) |
4575 update_mouseshape(SHAPE_IDX_VSEP); | 4580 update_mouseshape(SHAPE_IDX_VSEP); |
4576 # endif | 4581 # endif |
4577 else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0 | 4582 else if (!(State & CMDLINE) && W_STATUS_HEIGHT(wp) > 0 |
4578 && row == wp->w_height) | 4583 && row == wp->w_height && msg_scrolled == 0) |
4579 update_mouseshape(SHAPE_IDX_STATUS); | 4584 update_mouseshape(SHAPE_IDX_STATUS); |
4580 else | 4585 else |
4581 update_mouseshape(-2); | 4586 update_mouseshape(-2); |
4582 # endif | 4587 # endif |
4583 return wp; | 4588 return wp; |
4823 { | 4828 { |
4824 while (*text != NUL) | 4829 while (*text != NUL) |
4825 { | 4830 { |
4826 #ifdef FEAT_MBYTE | 4831 #ifdef FEAT_MBYTE |
4827 int l = (*mb_ptr2len)(text); | 4832 int l = (*mb_ptr2len)(text); |
4833 | |
4828 if (l > 1) | 4834 if (l > 1) |
4829 { | 4835 { |
4830 while (--l >= 0) | 4836 while (--l >= 0) |
4831 ga_append(gap, *text++); | 4837 ga_append(gap, *text++); |
4832 continue; | 4838 continue; |