Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

normal コマンドから実行したスクリプトで input() が動作しない #469

Closed
mattn opened this issue Sep 20, 2013 · 5 comments

Comments

Projects
None yet
3 participants
@mattn
Copy link
Member

commented Sep 20, 2013

function! s:confirm_and_input()
  let a = confirm("Your Sex?", "Male\nFemale")
  echo input("Your Name?", )
endfunction

nnoremap <buffer> <c-d> :call <SID>confirm_and_input()<cr>
exe "normal \<c-d>"

confirm は動作するが input は ex_normal_busy 扱いでキャンセルされる。

@mattn

This comment has been minimized.

Copy link
Member Author

commented Sep 20, 2013

diff -r a83960ec9e6d src/eval.c
--- a/src/eval.c    Sun Sep 08 20:00:48 2013 +0200
+++ b/src/eval.c    Fri Sep 20 10:58:48 2013 +0900
@@ -13052,10 +13052,18 @@
        }
    }

-   if (defstr != NULL)
+   if (defstr != NULL) {
+#ifdef FEAT_EX_EXTRA
+       int save_ex_normal_busy;
+       ex_normal_busy = 0;
+#endif
        rettv->vval.v_string =
        getcmdline_prompt(inputsecret_flag ? NUL : '@', p, echo_attr,
                  xp_type, xp_arg);
+#ifdef FEAT_EX_EXTRA
+       ex_normal_busy = save_ex_normal_busy;
+#endif
+   }
    if (inputdialog && rettv->vval.v_string == NULL
        && argvars[1].v_type != VAR_UNKNOWN
        && argvars[2].v_type != VAR_UNKNOWN)
@mattn

This comment has been minimized.

@Shougo

This comment has been minimized.

Copy link
Member

commented Sep 21, 2013

@mattn ++;

@k-takata

This comment has been minimized.

Copy link
Member

commented Sep 22, 2013

todo.txt 入りしました。

Patch to make input() work while inside :normal. (Yasuhiro Matsumoto, 2013 Sep
19)

@k-takata k-takata closed this Sep 22, 2013

@k-takata

This comment has been minimized.

Copy link
Member

commented Oct 2, 2013

@ghost ghost assigned mattn Oct 3, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.