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 #4904)
diff --git a/src/mbyte.c b/src/mbyte.c
index 2b76400..808194f 100644
--- a/src/mbyte.c
+++ b/src/mbyte.c
@@ -6497,6 +6497,18 @@
 
 #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".