comparison src/window.c @ 22699:e82579016863 v8.2.1898

patch 8.2.1898: command modifier parsing always uses global cmdmod Commit: https://github.com/vim/vim/commit/e10044015841711b989f9a898d427bcc1fdb4c32 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 24 20:49:43 2020 +0200 patch 8.2.1898: command modifier parsing always uses global cmdmod Problem: Command modifier parsing always uses global cmdmod. Solution: Pass in cmdmod_T to use. Rename struct fields consistently.
author Bram Moolenaar <Bram@vim.org>
date Sat, 24 Oct 2020 21:00:05 +0200
parents f7471450243c
children e871a824efc9
comparison
equal deleted inserted replaced
22698:28523bc9ee71 22699:e82579016863
613 break; 613 break;
614 614
615 #ifdef FEAT_SEARCHPATH 615 #ifdef FEAT_SEARCHPATH
616 case 'f': // CTRL-W gf: "gf" in a new tab page 616 case 'f': // CTRL-W gf: "gf" in a new tab page
617 case 'F': // CTRL-W gF: "gF" in a new tab page 617 case 'F': // CTRL-W gF: "gF" in a new tab page
618 cmdmod.tab = tabpage_index(curtab) + 1; 618 cmdmod.cmod_tab = tabpage_index(curtab) + 1;
619 nchar = xchar; 619 nchar = xchar;
620 goto wingotofile; 620 goto wingotofile;
621 #endif 621 #endif
622 case 't': // CTRL-W gt: go to next tab page 622 case 't': // CTRL-W gt: go to next tab page
623 goto_tabpage((int)Prenum); 623 goto_tabpage((int)Prenum);
796 // When the ":tab" modifier was used open a new tab page instead. 796 // When the ":tab" modifier was used open a new tab page instead.
797 if (may_open_tabpage() == OK) 797 if (may_open_tabpage() == OK)
798 return OK; 798 return OK;
799 799
800 // Add flags from ":vertical", ":topleft" and ":botright". 800 // Add flags from ":vertical", ":topleft" and ":botright".
801 flags |= cmdmod.split; 801 flags |= cmdmod.cmod_split;
802 if ((flags & WSP_TOP) && (flags & WSP_BOT)) 802 if ((flags & WSP_TOP) && (flags & WSP_BOT))
803 { 803 {
804 emsg(_("E442: Can't split topleft and botright at the same time")); 804 emsg(_("E442: Can't split topleft and botright at the same time"));
805 return FAIL; 805 return FAIL;
806 } 806 }
3566 continue; 3566 continue;
3567 } 3567 }
3568 if (!r) 3568 if (!r)
3569 { 3569 {
3570 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG) 3570 #if defined(FEAT_GUI_DIALOG) || defined(FEAT_CON_DIALOG)
3571 if (message && (p_confirm || cmdmod.confirm) && p_write) 3571 if (message && (p_confirm
3572 || (cmdmod.cmod_flags & CMOD_CONFIRM)) && p_write)
3572 { 3573 {
3573 dialog_changed(wp->w_buffer, FALSE); 3574 dialog_changed(wp->w_buffer, FALSE);
3574 if (!win_valid(wp)) // autocommands messed wp up 3575 if (!win_valid(wp)) // autocommands messed wp up
3575 { 3576 {
3576 nextwp = firstwin; 3577 nextwp = firstwin;
3923 * Returns OK if a new tab page was created, FAIL otherwise. 3924 * Returns OK if a new tab page was created, FAIL otherwise.
3924 */ 3925 */
3925 static int 3926 static int
3926 may_open_tabpage(void) 3927 may_open_tabpage(void)
3927 { 3928 {
3928 int n = (cmdmod.tab == 0) ? postponed_split_tab : cmdmod.tab; 3929 int n = (cmdmod.cmod_tab == 0)
3930 ? postponed_split_tab : cmdmod.cmod_tab;
3929 3931
3930 if (n != 0) 3932 if (n != 0)
3931 { 3933 {
3932 cmdmod.tab = 0; // reset it to avoid doing it twice 3934 cmdmod.cmod_tab = 0; // reset it to avoid doing it twice
3933 postponed_split_tab = 0; 3935 postponed_split_tab = 0;
3934 return win_new_tabpage(n); 3936 return win_new_tabpage(n);
3935 } 3937 }
3936 return FAIL; 3938 return FAIL;
3937 } 3939 }