Code Monkey home page Code Monkey logo

Comments (7)

nemo-nullius avatar nemo-nullius commented on May 28, 2024

Actually, even if I open sublime-text by clicking on the icon, I still have this problem of deleting words in the wrong place...

So could you kindly show me the configuration in your sublime-text.desktop please? @Xiang-DangDang

from sublime-text-imfix.

steven-ok avatar steven-ok commented on May 28, 2024

我的配置文件没有改动过,下载安装后,除了安装你提供的 sublime-text-imfix 插件,没有过任何改动,我使用的操作系统为 基于 debian 的 deepin,以下是我的 sublime-text 配置文件,目前使用最新版本的sublime-text,这个问题在以前版本也出现

[Desktop Entry]
Version=1.0
Type=Application
Name=Sublime Text
GenericName=Text Editor
Comment=Sophisticated text editor for code, markup and prose
#Exec=/opt/sublime_text/sublime_text %F
Exec=/usr/bin/subl %F
Terminal=false
MimeType=text/plain;
Icon=sublime-text
Categories=TextEditor;Development;
StartupNotify=true
Actions=Window;Document;
StartupWMClass=Sublime_text

[Desktop Action Window]
Name=New Window
#Exec=/opt/sublime_text/sublime_text -n
Exec=/usr/bin/subl -n
OnlyShowIn=Unity;

[Desktop Action Document]
Name=New File
#Exec=/opt/sublime_text/sublime_text --command new_file
Exec=/usr/bin/subl --command new_file
OnlyShowIn=Unity;

from sublime-text-imfix.

nemo-nullius avatar nemo-nullius commented on May 28, 2024

你好!

首先我不是作者,我也是同样遇到这个问题的使用者。

不过我的状况更糟一些,因为我即便双击图标打开 sublime 也无法正常使用退格键。另外,在我的系统里,直接使用作者提供的 .so 文件是无法在 sublime 里成功使用 fcitx 的——每次切换到 fcitx ,都会立即跳回为英文输入法,完全无法使用。还得先修改源代码,将其中关于 fcitx 的部分删掉,只保留关于 xim 的部分,再重新编译为 .so 文件,这时才能在 sublime 里用 fcitx 。(我自己开了个 issue 描述这个奇怪的问题,不过作者回复说无法重现,见 #50 )不过这样带来的好处是, ibus 倒能用了。。。

我的系统是:

  • Ubuntu 14.04 + i3wm (其实在 xfce4/mate 桌面下也试过,都不行)
  • fcitx 4.2.8.5
  • Sublime Text 3 Build 3143

这样看来,还是只能滚回继续用 vim 了。。但好喜欢 sublime 的新配色 Mariana 啊 T_T 。。

from sublime-text-imfix.

nemo-nullius avatar nemo-nullius commented on May 28, 2024

Now I have come up with a way to partially solve this problem of deleting with backspace. Although it has some shortcomings, it could at least provide a fairly acceptive experience of typing Chinese characters with fcitx.

  1. Open Preferences -> Key Bindings in sublime.
  2. Copy all the contents from the left column (Default) to the right column (User).
  3. Comment this line : //{ "keys": ["backspace"], "command": "left_delete" }, in the right column (User). (It is Line 19 in my file.)
  4. Open a terminal, and go into the configuration folder of sublime, like ~/.config/sublime-text-3/Packages/.
  5. Make a new folder "Default" in the folder "Packages": mkdir Default.
  6. Copy the user keymap file to this "Default" folder: cp ./User/Default\ \(Linux\).sublime-keymap ./Default

Now backspace will behave correctly - it will delete words in the input box of fcitx rather than in sublime.

The theory is that although the default .sublime-keymap is read-only, the .sublime-keymap file in the Default folder will override the original default one, and thus we can modify it. Therefore, with the line of backspace key in the default keymap file deleted, sublime loses the control of backspace, and thus fcitx could get control of that key when in need.

But this method is not perfect. It has a side effect - the backspace key can never be used in sublime any more. To work around, we can just use shift+backspace which has the same function with backspace, or try to use del key, or even vim mode. : )

Reference:
https://forum.sublimetext.com/t/input-method-support/5446/30 (See stevenfrog's post)

PS.
If you are using some plugins concerning applying (new) keymap, also remember to comment/delete the lines with backspace key involved, or the plugins will ask sublime to back again take control of backspace and never give the control of that key to fcitx. Like as for the package ActuralVim, we need to comment // { "keys": ["backspace"], "args": {"key": "<bs>"}, "context": [{ "key": "setting.actual_intercept", "operand": true }], "command": "actual_keypress" }, (Line 23 in my file) in the keymap configuration file of ActualVim, which is ~/.config/sublime-text-3/Packages/ActualVim/Default.sublime-keymap.

PSS.
In order not to cause some other bugs in ActualVim, like the wrong behavior of insert after deleting with shift+backspace - the words are inserted in the position before deleting rather than after it, we should change "backspace" to "shift+backspace" in the line mentioned above in the keymap configuration file of ActualVim, rather than simply comment/delete that line.

from sublime-text-imfix.

videni avatar videni commented on May 28, 2024

我也同样遇到了这个问题。不过,我不是通过subl命令打开,而是,直接点击sublime桌面图标打开。

from sublime-text-imfix.

ppflower avatar ppflower commented on May 28, 2024

在我这里只有新创建的文件被保存的时候才会发生这种问题。cmd/ctrl+s保存完接着编辑的时候所有的窗口都会出现delete键删除不正常的问题。

from sublime-text-imfix.

zh-zheng avatar zh-zheng commented on May 28, 2024

在我这里只有新创建的文件被保存的时候才会发生这种问题。cmd/ctrl+s保存完接着编辑的时候所有的窗口都会出现delete键删除不正常的问题。

我也是这样,现在我明白什么时候才会触发了。

from sublime-text-imfix.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.