From 211932fdd701329a9d9ef8c5be7c5c761bd577b5 Mon Sep 17 00:00:00 2001 From: Don Ho Date: Sun, 12 Aug 2012 01:25:22 +0000 Subject: [PATCH] [BUG_FIXED] Walk around Notepad++ hanging on C(JK?) input with ANSI document while enabling word completion. git-svn-id: svn://svn.tuxfamily.org/svnroot/notepadplus/repository/trunk@939 f5eea248-9336-0410-98b8-ebc06183d4e3 --- .../src/ScitillaComponent/AutoCompletion.cpp | 5 +++- .../src/ScitillaComponent/ScintillaEditView.h | 30 +++---------------- 2 files changed, 8 insertions(+), 27 deletions(-) diff --git a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp index 77d79c641..7b1efbf16 100644 --- a/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp +++ b/PowerEditor/src/ScitillaComponent/AutoCompletion.cpp @@ -189,7 +189,10 @@ void AutoCompletion::update(int character) if (lstrlen(s) >= int(nppGUI._autocFromLen)) { if (nppGUI._autocStatus == nppGUI.autoc_word) - showWordComplete(false); + { + if (!_pEditView->isCJK()) + showWordComplete(false); + } else if (nppGUI._autocStatus == nppGUI.autoc_func) showAutoComplete(); } diff --git a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h index 94839a002..a9ea90fd9 100644 --- a/PowerEditor/src/ScitillaComponent/ScintillaEditView.h +++ b/PowerEditor/src/ScitillaComponent/ScintillaEditView.h @@ -613,29 +613,12 @@ public: void setTabSettings(Lang *lang); bool isWrapRestoreNeeded() const {return _wrapRestoreNeeded;}; void setWrapRestoreNeeded(bool isWrapRestoredNeeded) {_wrapRestoreNeeded = isWrapRestoredNeeded;}; -/* - pair getLineUndoState(size_t currentLine) { - Buffer * buf = getCurrentBuffer(); - return buf->getLineUndoState(currentLine); - }; - void setLineUndoState(size_t currentLine, size_t undoLevel, bool isSaved = false) { - Buffer * buf = getCurrentBuffer(); - buf->setLineUndoState(currentLine, undoLevel, isSaved); - }; - void markSavedLines() { - for (int i = 0 ; i <= lastZeroBasedLineNumber() ; i++) - { - if ((execute(SCI_MARKERGET, i) & (1 << MARK_LINEMODIFIEDUNSAVED)) != 0) - { - execute(SCI_MARKERDELETE, i, MARK_LINEMODIFIEDUNSAVED); - execute(SCI_MARKERADD, i, MARK_LINEMODIFIEDSAVED); - //pair st = getLineUndoState(i); - setLineUndoState(i, 0, true); - } - } + bool isCJK() const { + return ((_codepage == CP_CHINESE_TRADITIONAL) || (_codepage == CP_CHINESE_SIMPLIFIED) || + (_codepage == CP_JAPANESE) || (_codepage == CP_KOREAN)); }; -*/ + protected: static HINSTANCE _hLib; static int _refCount; @@ -906,11 +889,6 @@ protected: execute(SCI_MARKERSETBACKSELECTED, marker, foreActive); }; - bool isCJK() const { - return ((_codepage == CP_CHINESE_TRADITIONAL) || (_codepage == CP_CHINESE_SIMPLIFIED) || - (_codepage == CP_JAPANESE) || (_codepage == CP_KOREAN)); - }; - int codepage2CharSet() const { switch (_codepage) {