From bd6fc8c0919f92d39b9990fdf63d1781cc47926f Mon Sep 17 00:00:00 2001 From: oxalica Date: Fri, 20 Aug 2021 16:06:01 +0800 Subject: [PATCH] Fix types and wording --- README.md | 4 ++-- plugin/fcitx.vim | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 129c94c..1c2ae92 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ D-Bus only works with the same user so this won't work with `sudo vim`. See the By default, it use python3 and D-Bus to toggle IME state. If you set `g:fcitx5_remote` to the executable path of `fcitx5-remote` **BEFORE** loading the plugin, it will use `fcitx5-remote` instead of python and D-Bus. In this case, python3 support is optional. -Usually `fcitx5-remote` mode is way faster since python script need 400ms+ for the initial load. +Usually `fcitx5-remote` mode is way faster since Python script need quite some time for the initial load if you don't use any other plugins that load Python. Base requirements: @@ -36,7 +36,7 @@ D-Bus 只在同一用户时有效,所以使用 `sudo vim` 时本代码就失 本插件默认会使用 Python 3 并通过 D-Bus 来切换输入法状态。 但如果你在加载插件**之前**设置了 `g:fcitx5_remote` 为你已安装的 `fcitx5-remote` 可执行文件的路径,那么本插件会使用它来切换输入法状态;此模式下本插件并不需要 Python 。 -通常 Python 模式首次加载很慢,需要 400ms+ ,而 `fcitx5-remote` 模式则不会拖慢启动时间。 +如果你没有其他使用 Python 的 Vim 插件,本插件的 Python 模式初始化可能会显著拖慢启动时间;而 `fcitx5-remote` 模式则没有这个问题。 基本要求: diff --git a/plugin/fcitx.vim b/plugin/fcitx.vim index bac4e26..9b4d47c 100644 --- a/plugin/fcitx.vim +++ b/plugin/fcitx.vim @@ -14,8 +14,8 @@ set cpo&vim " If g:fcitx5_remote is set (to the path to `fcitx5-remove`), use it to toggle IME state. if exists("g:fcitx5_remote") function Fcitx2en() - let inputstatus = system(g:fcitx5_remote) - if inputstatus == 2 + let inputstatus = trim(system(g:fcitx5_remote)) + if inputstatus == '2' let b:inputtoggle = 1 call system(g:fcitx5_remote . ' -c') endif