comparison src/ex_getln.c @ 510:b47114409935

updated for version 7.0143
author vimboss
date Wed, 07 Sep 2005 21:18:43 +0000
parents a1059cda45f2
children da9142bd190a
comparison
equal deleted inserted replaced
509:c30adca15506 510:b47114409935
5476 garray_T winsizes; 5476 garray_T winsizes;
5477 char_u typestr[2]; 5477 char_u typestr[2];
5478 int save_restart_edit = restart_edit; 5478 int save_restart_edit = restart_edit;
5479 int save_State = State; 5479 int save_State = State;
5480 int save_exmode = exmode_active; 5480 int save_exmode = exmode_active;
5481 #ifdef FEAT_RIGHTLEFT
5482 int save_cmdmsg_rl = cmdmsg_rl;
5483 #endif
5481 5484
5482 /* Can't do this recursively. Can't do it when typing a password. */ 5485 /* Can't do this recursively. Can't do it when typing a password. */
5483 if (cmdwin_type != 0 5486 if (cmdwin_type != 0
5484 # if defined(FEAT_CRYPT) || defined(FEAT_EVAL) 5487 # if defined(FEAT_CRYPT) || defined(FEAT_EVAL)
5485 || cmdline_star > 0 5488 || cmdline_star > 0
5512 (void)setfname(curbuf, (char_u *)"command-line", NULL, TRUE); 5515 (void)setfname(curbuf, (char_u *)"command-line", NULL, TRUE);
5513 set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); 5516 set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL);
5514 set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); 5517 set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
5515 curbuf->b_p_ma = TRUE; 5518 curbuf->b_p_ma = TRUE;
5516 # ifdef FEAT_RIGHTLEFT 5519 # ifdef FEAT_RIGHTLEFT
5517 curwin->w_p_rl = FALSE; 5520 curwin->w_p_rl = cmdmsg_rl;
5521 cmdmsg_rl = FALSE;
5518 # endif 5522 # endif
5519 # ifdef FEAT_SCROLLBIND 5523 # ifdef FEAT_SCROLLBIND
5520 curwin->w_p_scb = FALSE; 5524 curwin->w_p_scb = FALSE;
5521 # endif 5525 # endif
5522 5526
5523 # ifdef FEAT_AUTOCMD 5527 # ifdef FEAT_AUTOCMD
5524 /* Do execute autocommands for setting the filetype (load syntax). */ 5528 /* Do execute autocommands for setting the filetype (load syntax). */
5525 --autocmd_block; 5529 --autocmd_block;
5526 # endif 5530 # endif
5531
5532 /* Showing the prompt may have set need_wait_return, reset it. */
5533 need_wait_return = FALSE;
5527 5534
5528 histtype = hist_char2type(ccline.cmdfirstc); 5535 histtype = hist_char2type(ccline.cmdfirstc);
5529 if (histtype == HIST_CMD || histtype == HIST_DEBUG) 5536 if (histtype == HIST_CMD || histtype == HIST_DEBUG)
5530 { 5537 {
5531 if (p_wc == TAB) 5538 if (p_wc == TAB)
5563 /* Replace the empty last line with the current command-line and put the 5570 /* Replace the empty last line with the current command-line and put the
5564 * cursor there. */ 5571 * cursor there. */
5565 ml_replace(curbuf->b_ml.ml_line_count, ccline.cmdbuff, TRUE); 5572 ml_replace(curbuf->b_ml.ml_line_count, ccline.cmdbuff, TRUE);
5566 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count; 5573 curwin->w_cursor.lnum = curbuf->b_ml.ml_line_count;
5567 curwin->w_cursor.col = ccline.cmdpos; 5574 curwin->w_cursor.col = ccline.cmdpos;
5575 changed_line_abv_curs();
5576 invalidate_botline();
5568 redraw_later(NOT_VALID); 5577 redraw_later(NOT_VALID);
5569 5578
5570 /* Save the command line info, can be used recursively. */ 5579 /* Save the command line info, can be used recursively. */
5571 save_ccline = ccline; 5580 save_ccline = ccline;
5572 ccline.cmdbuff = NULL; 5581 ccline.cmdbuff = NULL;
5623 if (aborting() && cmdwin_result != K_IGNORE) 5632 if (aborting() && cmdwin_result != K_IGNORE)
5624 cmdwin_result = Ctrl_C; 5633 cmdwin_result = Ctrl_C;
5625 # endif 5634 # endif
5626 /* Set the new command line from the cmdline buffer. */ 5635 /* Set the new command line from the cmdline buffer. */
5627 vim_free(ccline.cmdbuff); 5636 vim_free(ccline.cmdbuff);
5628 if (cmdwin_result == K_XF1) /* :qa! typed */ 5637 if (cmdwin_result == K_XF1 || cmdwin_result == K_XF2) /* :qa[!] typed */
5629 { 5638 {
5630 ccline.cmdbuff = vim_strsave((char_u *)"qa!"); 5639 char *p = (cmdwin_result == K_XF2) ? "qa" : "qa!";
5631 cmdwin_result = CAR; 5640
5641 if (histtype == HIST_CMD)
5642 {
5643 /* Execute the command directly. */
5644 ccline.cmdbuff = vim_strsave((char_u *)p);
5645 cmdwin_result = CAR;
5646 }
5647 else
5648 {
5649 /* First need to cancel what we were doing. */
5650 ccline.cmdbuff = NULL;
5651 stuffcharReadbuff(':');
5652 stuffReadbuff((char_u *)p);
5653 stuffcharReadbuff(CAR);
5654 }
5632 } 5655 }
5633 else if (cmdwin_result == K_XF2) /* :qa typed */ 5656 else if (cmdwin_result == K_XF2) /* :qa typed */
5634 { 5657 {
5635 ccline.cmdbuff = vim_strsave((char_u *)"qa"); 5658 ccline.cmdbuff = vim_strsave((char_u *)"qa");
5636 cmdwin_result = CAR; 5659 cmdwin_result = CAR;
5671 # endif 5694 # endif
5672 } 5695 }
5673 5696
5674 ga_clear(&winsizes); 5697 ga_clear(&winsizes);
5675 restart_edit = save_restart_edit; 5698 restart_edit = save_restart_edit;
5699 # ifdef FEAT_RIGHTLEFT
5700 cmdmsg_rl = save_cmdmsg_rl;
5701 # endif
5676 5702
5677 State = save_State; 5703 State = save_State;
5678 # ifdef FEAT_MOUSE 5704 # ifdef FEAT_MOUSE
5679 setmouse(); 5705 setmouse();
5680 # endif 5706 # endif