h-hg / fcitx.nvim

A Neovim plugin writing in Lua to switch and restore fcitx state for each buffer.
MIT License
85 stars 10 forks source link

Sensible IM switching lag on Linux #3

Open Sduby22 opened 2 years ago

Sduby22 commented 2 years ago

alohaia/fcitx.nvim: no sensible lag when changing modes. h-hg/fcitx.nvim: perceptible lag (~100ms) on mode switch.

NVIM v0.7.2
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by builduser

runs on Manjaro Linux with fcitx5-remote

h-hg commented 2 years ago

I found that you have forked my repo and combined alohaia/fcitx.nvim and h-hg/fcitx.nvim. In the early verison, I also used io.popen or os.execute to call fcitx-remote. However, the neovim will display the log message or the error message when using fcitx-remote in OSX. And it has been found in issue 2. An simple way to reproduce it is that you replace the fcitx-remote -c / fcitx-remote -o with a program which writes log message. For exmaple,

#include <iostream>
using namespace std;
int main() {
  cout << "std out\n";
  cerr << "error out\n";
  clog << "log out\n";
  return 0;
}

I don't know why vim.fn.system doesn't display.