diff src/mbyte.c @ 18008:8ae333756614 v8.1.2000

patch 8.1.2000: plugin cannot get the current IME status Commit: https://github.com/vim/vim/commit/a3a124627d2eb9d36e3dc3757429d87e041f8c0b Author: Bram Moolenaar <Bram@vim.org> Date: Sat Sep 7 15:08:38 2019 +0200 patch 8.1.2000: plugin cannot get the current IME status Problem: Plugin cannot get the current IME status. Solution: Add the getimstatus() function. (closes https://github.com/vim/vim/issues/4904)
author Bram Moolenaar <Bram@vim.org>
date Sat, 07 Sep 2019 15:15:04 +0200
parents 484424955bfa
children 82543df649ba
line wrap: on
line diff
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -6497,6 +6497,18 @@ im_set_position(int row UNUSED, int col 
 
 #endif /* FEAT_XIM */
 
+#if defined(FEAT_EVAL) || defined(PROTO)
+/*
+ * "getimstatus()" function
+ */
+    void
+f_getimstatus(typval_T *argvars UNUSED, typval_T *rettv)
+{
+# if defined(HAVE_INPUT_METHOD)
+    rettv->vval.v_number = im_get_status();
+# endif
+}
+#endif
 
 /*
  * Setup "vcp" for conversion from "from" to "to".