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

IDM_VIEW_AUTOC_ENGLISH_ONLY seems not work properly #73

Closed
bluenlive opened this issue Sep 16, 2018 · 3 comments
Closed

IDM_VIEW_AUTOC_ENGLISH_ONLY seems not work properly #73

bluenlive opened this issue Sep 16, 2018 · 3 comments

Comments

@bluenlive
Copy link

With Korean IME(maybe with other IMEs), IDM_VIEW_AUTOC_ENGLISH_ONLY seems not work properly.
Even when IDM_VIEW_AUTOC_ENGLISH_ONLY is false, we cannot use "auto completion" feature with Korean.

Maybe following lines in notepad.c causes it:

		case SCN_CHARADDED:
			if (scn->ch > 0x7F) {
				return 0;
			}

Could you check it?

@zufuliu
Copy link
Owner

zufuliu commented Sep 16, 2018

Notapad2 (currently) only support auto-completion for _a-zA-Z0-9 and some punctuation, a later version may add support for extended Latin characters, see #36.

The new option "Auto Complete Words Only in English IME Mode" is that, modern IME in native mode (Chinese, Japanese, Korean, etc.) may let user select English words, when this option is enabled, the selected word will NOT trigger auto-completion.

I think directly type Korean text is quicker than auto-completion.
Another reason is that CJK text doesn't has space between characters, auto-completion with a full sentence (or paragraph in ANSI encoding mode, as punctuation is treated as word in Scintilla, this is still not fixed, see https://sourceforge.net/p/scintilla/feature-requests/1226/).

@bluenlive
Copy link
Author

Okay. I understand it.
I'll close this issue.

Thank you, always.

@zufuliu
Copy link
Owner

zufuliu commented Jan 13, 2019

Hi @bluenlive, auto completion for Korean is possible (by Alt + / or Edit -> Insert -> Complete Word) since commit c4f533e.

Auto completion on typing can be implemented (as an option?) by change SCN_CHARADDED:
https://github.com/zufuliu/notepad2/blob/master/src/Notepad2.c#L4880

if (!autoCompletionConfig.bCompleteWord
	// ignore IME input
	|| (scn->modifiers && (ch >= 0x80 || autoCompletionConfig.bEnglistIMEModeOnly))
	|| !IsAutoCompletionWordCharacter(ch)
) {
	return 0;
}

and IsAutoCompletionWordCharacter():
https://github.com/zufuliu/notepad2/blob/master/scintilla/src/Document.h#L549

bool IsAutoCompletionWordCharacter(unsigned int ch) const noexcept {
	return WordCharacterClass(ch) == CharClassify::ccWord;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants