aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2000-04-08 11:59:28 +0000
committernyamatongwe <devnull@localhost>2000-04-08 11:59:28 +0000
commitefa40dbcc958f03b539902aae87c17b138552ce0 (patch)
treebca7871b6c92dd54755b6e613fb18eba0e28c021 /src
parent4fe90137dc48e5ca07e9223694ab8926c9ebbf13 (diff)
downloadscintilla-mirror-efa40dbcc958f03b539902aae87c17b138552ce0.tar.gz
Unicode keyboard input and dragging from Scintilla.
Fixing warnings on GTK+ and uping warning level.
Diffstat (limited to 'src')
-rw-r--r--src/Editor.cxx13
-rw-r--r--src/Editor.h3
-rw-r--r--src/LexCPP.cxx2
-rw-r--r--src/ScintillaBase.cxx6
-rw-r--r--src/ScintillaBase.h2
5 files changed, 17 insertions, 9 deletions
diff --git a/src/Editor.cxx b/src/Editor.cxx
index 859421c92..677013a00 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -1300,6 +1300,13 @@ void Editor::SetScrollBars() {
}
void Editor::AddChar(char ch) {
+ char s[2];
+ s[0] = ch;
+ s[1] = '\0';
+ AddCharUTF(s, 1);
+}
+
+void Editor::AddCharUTF(char *s, unsigned int len) {
bool wasSelection = currentPos != anchor;
ClearSelection();
if (inOverstrike && !wasSelection) {
@@ -1309,11 +1316,11 @@ void Editor::AddChar(char ch) {
}
}
}
- pdoc->InsertChar(currentPos, ch);
- SetEmptySelection(currentPos + 1);
+ pdoc->InsertString(currentPos, s, len);
+ SetEmptySelection(currentPos + len);
EnsureCaretVisible();
SetLastXChosen();
- NotifyChar(ch);
+ NotifyChar(s[0]);
}
void Editor::ClearSelection() {
diff --git a/src/Editor.h b/src/Editor.h
index 1dccf35c7..fe670ddd5 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -192,7 +192,8 @@ protected: // ScintillaBase subclass needs access to much of Editor
void SetScrollBarsTo(PRectangle rsClient);
void SetScrollBars();
- virtual void AddChar(char ch);
+ void AddChar(char ch);
+ virtual void AddCharUTF(char *s, unsigned int len);
void ClearSelection();
void ClearAll();
void Cut();
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx
index b67779842..418c1133e 100644
--- a/src/LexCPP.cxx
+++ b/src/LexCPP.cxx
@@ -163,7 +163,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
}
} else if (state == SCE_C_COMMENTDOC) {
if (ch == '/' && chPrev == '*') {
- if (((i > styler.GetStartSegment() + 3) || (
+ if (((i > styler.GetStartSegment() + 2) || (
(initStyle == SCE_C_COMMENTDOC) &&
(styler.GetStartSegment() == static_cast<unsigned int>(startPos))))) {
styler.ColourTo(i, state);
diff --git a/src/ScintillaBase.cxx b/src/ScintillaBase.cxx
index 6683c0146..80ef3097b 100644
--- a/src/ScintillaBase.cxx
+++ b/src/ScintillaBase.cxx
@@ -52,11 +52,11 @@ void ScintillaBase::RefreshColourPalette(Palette &pal, bool want) {
ct.RefreshColourPalette(pal, want);
}
-void ScintillaBase::AddChar(char ch) {
+void ScintillaBase::AddCharUTF(char *s, unsigned int len) {
bool acActiveBeforeCharAdded = ac.Active();
- Editor::AddChar(ch);
+ Editor::AddCharUTF(s, len);
if (acActiveBeforeCharAdded)
- AutoCompleteChanged(ch);
+ AutoCompleteChanged(s[0]);
}
void ScintillaBase::Command(int cmdId) {
diff --git a/src/ScintillaBase.h b/src/ScintillaBase.h
index ec64ab5dd..6344b17a3 100644
--- a/src/ScintillaBase.h
+++ b/src/ScintillaBase.h
@@ -45,7 +45,7 @@ protected:
virtual void RefreshColourPalette(Palette &pal, bool want);
- virtual void AddChar(char ch);
+ virtual void AddCharUTF(char *s, unsigned int len);
void Command(int cmdId);
virtual int KeyCommand(UINT iMessage);