Mercurial > vim
comparison src/ex_getln.c @ 30329:8496a2c45962 v9.0.0500
patch 9.0.0500: when quitting cmdline window with CTRL-C it remains visible
Commit: https://github.com/vim/vim/commit/b2f0ca820eae50994745106d824e215d87bd7926
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Sep 18 15:08:19 2022 +0100
patch 9.0.0500: when quitting cmdline window with CTRL-C it remains visible
Problem: When quitting the cmdline window with CTRL-C it remains visible.
Solution: Redraw to avoid confusion. Adjust the error message.
(closes #11152) Adjust the cursor position after CTRL-C.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 18 Sep 2022 16:15:03 +0200 |
parents | 6b541aaaf39e |
children | 101f08b49ed3 |
comparison
equal
deleted
inserted
replaced
30328:60f24e323057 | 30329:8496a2c45962 |
---|---|
4629 else | 4629 else |
4630 { | 4630 { |
4631 ccline.cmdlen = (int)STRLEN(ccline.cmdbuff); | 4631 ccline.cmdlen = (int)STRLEN(ccline.cmdbuff); |
4632 ccline.cmdbufflen = ccline.cmdlen + 1; | 4632 ccline.cmdbufflen = ccline.cmdlen + 1; |
4633 ccline.cmdpos = curwin->w_cursor.col; | 4633 ccline.cmdpos = curwin->w_cursor.col; |
4634 if (ccline.cmdpos > ccline.cmdlen) | 4634 // If the cursor is on the last character, it probably should be |
4635 // after it. | |
4636 if (ccline.cmdpos == ccline.cmdlen - 1 | |
4637 || ccline.cmdpos > ccline.cmdlen) | |
4635 ccline.cmdpos = ccline.cmdlen; | 4638 ccline.cmdpos = ccline.cmdlen; |
4636 if (cmdwin_result == K_IGNORE) | |
4637 { | |
4638 set_cmdspos_cursor(); | |
4639 redrawcmd(); | |
4640 } | |
4641 } | 4639 } |
4642 | 4640 |
4643 # ifdef FEAT_CONCEAL | 4641 # ifdef FEAT_CONCEAL |
4644 // Avoid command-line window first character being concealed. | 4642 // Avoid command-line window first character being concealed. |
4645 curwin->w_p_cole = 0; | 4643 curwin->w_p_cole = 0; |
4662 close_buffer(NULL, bufref.br_buf, DOBUF_WIPE, FALSE, FALSE); | 4660 close_buffer(NULL, bufref.br_buf, DOBUF_WIPE, FALSE, FALSE); |
4663 | 4661 |
4664 // Restore window sizes. | 4662 // Restore window sizes. |
4665 win_size_restore(&winsizes); | 4663 win_size_restore(&winsizes); |
4666 skip_win_fix_cursor = FALSE; | 4664 skip_win_fix_cursor = FALSE; |
4665 | |
4666 if (cmdwin_result == K_IGNORE) | |
4667 { | |
4668 // It can be confusing that the cmdwin still shows, redraw the | |
4669 // screen. | |
4670 update_screen(UPD_VALID); | |
4671 set_cmdspos_cursor(); | |
4672 redrawcmd(); | |
4673 } | |
4667 } | 4674 } |
4668 | 4675 |
4669 ga_clear(&winsizes); | 4676 ga_clear(&winsizes); |
4670 restart_edit = save_restart_edit; | 4677 restart_edit = save_restart_edit; |
4671 # ifdef FEAT_RIGHTLEFT | 4678 # ifdef FEAT_RIGHTLEFT |