Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] Disable snippet expansion when IME is on #284

Closed
RyotaUshio opened this issue Apr 23, 2024 · 2 comments · Fixed by #286
Closed

[FEATURE] Disable snippet expansion when IME is on #284

RyotaUshio opened this issue Apr 23, 2024 · 2 comments · Fixed by #286
Labels
enhancement New feature or request

Comments

@RyotaUshio
Copy link
Contributor

RyotaUshio commented Apr 23, 2024

Thank you for maintaining this important plugin for all who do math in Obsidian. I have a suggestion which will be beneficial for those who use IME.

Description of the Problem

When I type "Vimキー" (which means "Vim keys" in Japanese), the keystroke looks like this:

Shift+V, i, m, (Turn on IME), k, i, -, (space to convert hiragana to katakana)

Then, the m before turning on the IME and k after that triggers the default mk snippet, and it results in the following, which is unwanted:

Vi$きー$

Description of the Solution

I think this problem can be eliminated by disabling expanding snippets while IME is on, i.e. when view.composing is true.

Additional

None

@RyotaUshio RyotaUshio added the enhancement New feature or request label Apr 23, 2024
@artisticat1
Copy link
Owner

Hi, thanks for raising an issue!

Issues relating to IME input have been raised in the past (#52, #213, #191). However, I have little knowledge of IME input methods and no easy way to test/debug a solution.

From your other plugins, it looks like you're familiar with CodeMirror. If you're able/willing, I'd happily accept a PR solving this issue! (If so, there's some discussion in the previously linked issues that may be of relevance.)

@lunarythia
Copy link

For those who find this issue in the future, I changed the first few lines to


	{trigger: "mk", replacement: "$$0$", options: "tw"},
	{trigger: "dm", replacement: "$$\n$0\n$$", options: "tw"},

because I personally found the automatic mk and dm to be annoying. I removed the A from options, so that you need to hit Tab in order to trigger the snippet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants