@@ -1653,6 +1653,9 @@ do_one_cmd(
16531653 int save_reg_executing = reg_executing ;
16541654 int ni ; // set when Not Implemented
16551655 char_u * cmd ;
1656+ #ifdef FEAT_EVAL
1657+ int starts_with_colon ;
1658+ #endif
16561659
16571660 vim_memset (& ea , 0 , sizeof (ea ));
16581661 ea .line1 = 1 ;
@@ -1695,6 +1698,7 @@ do_one_cmd(
16951698 ea .cookie = cookie ;
16961699#ifdef FEAT_EVAL
16971700 ea .cstack = cstack ;
1701+ starts_with_colon = * skipwhite (ea .cmd ) == ':' ;
16981702#endif
16991703 if (parse_command_modifiers (& ea , & errormsg , FALSE) == FAIL )
17001704 goto doend ;
@@ -1719,7 +1723,7 @@ do_one_cmd(
17191723 ea .cmd = skipwhite (ea .cmd + 1 );
17201724
17211725#ifdef FEAT_EVAL
1722- if (current_sctx .sc_version == SCRIPT_VERSION_VIM9 )
1726+ if (current_sctx .sc_version == SCRIPT_VERSION_VIM9 && ! starts_with_colon )
17231727 p = find_ex_command (& ea , NULL , lookup_scriptvar , NULL );
17241728 else
17251729#endif
@@ -3152,8 +3156,9 @@ find_ex_command(
31523156 * Recognize a Vim9 script function/method call and assignment:
31533157 * "lvar = value", "lvar(arg)", "[1, 2 3]->Func()"
31543158 */
3155- if (lookup != NULL && (p = to_name_const_end (eap -> cmd )) > eap -> cmd
3156- && * p != NUL )
3159+ p = eap -> cmd ;
3160+ if (lookup != NULL && (* p == '('
3161+ || ((p = to_name_const_end (eap -> cmd )) > eap -> cmd && * p != NUL )))
31573162 {
31583163 int oplen ;
31593164 int heredoc ;
@@ -3162,6 +3167,7 @@ find_ex_command(
31623167 // "varname[]" is an expression.
31633168 // "g:varname" is an expression.
31643169 // "varname->expr" is an expression.
3170+ // "(..." is an expression.
31653171 if (* p == '('
31663172 || * p == '['
31673173 || p [1 ] == ':'
@@ -3677,7 +3683,7 @@ get_address(
36773683 curwin -> w_cursor .col = 0 ;
36783684 searchcmdlen = 0 ;
36793685 flags = silent ? 0 : SEARCH_HIS | SEARCH_MSG ;
3680- if (!do_search (NULL , c , cmd , 1L , flags , NULL ))
3686+ if (!do_search (NULL , c , c , cmd , 1L , flags , NULL ))
36813687 {
36823688 curwin -> w_cursor = pos ;
36833689 cmd = NULL ;
@@ -6191,9 +6197,11 @@ do_exedit(
61916197 hold_gui_events = 0 ;
61926198#endif
61936199 must_redraw = CLEAR ;
6200+ pending_exmode_active = TRUE;
61946201
61956202 main_loop (FALSE, TRUE);
61966203
6204+ pending_exmode_active = FALSE;
61976205 RedrawingDisabled = rd ;
61986206 no_wait_return = nwr ;
61996207 msg_scroll = ms ;
0 commit comments