aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authornyamatongwe <unknown>2000-04-18 13:26:25 +0000
committernyamatongwe <unknown>2000-04-18 13:26:25 +0000
commit6e0886a5056dea51dda45684f5753569e2723daa (patch)
tree326b4b10e1293bc8a2eec9571553e0c54f72e793 /src
parent3a1d36a7e56c077a1cf97e45021081a94cb5ec7b (diff)
downloadscintilla-mirror-6e0886a5056dea51dda45684f5753569e2723daa.tar.gz
Removed PropSet from Accessor interface.
Indenting and horizontal scroll bar messages. Fixed undo grouping bug. Vertical scrolling can be performed with Ctrl+ arrows
Diffstat (limited to 'src')
-rw-r--r--src/CellBuffer.cxx1
-rw-r--r--src/DocumentAccessor.h4
-rw-r--r--src/Editor.cxx25
-rw-r--r--src/Editor.h2
-rw-r--r--src/KeyMap.cxx2
-rw-r--r--src/LexCPP.cxx6
-rw-r--r--src/LexPython.cxx4
-rw-r--r--src/LexSQL.cxx2
8 files changed, 39 insertions, 7 deletions
diff --git a/src/CellBuffer.cxx b/src/CellBuffer.cxx
index c89c1c8dd..9576e917d 100644
--- a/src/CellBuffer.cxx
+++ b/src/CellBuffer.cxx
@@ -449,6 +449,7 @@ void UndoHistory::BeginUndoAction() {
actions[currentAction].Create(startAction);
maxAction = currentAction;
}
+ actions[currentAction].mayCoalesce = false;
}
undoSequenceDepth++;
}
diff --git a/src/DocumentAccessor.h b/src/DocumentAccessor.h
index ab11544e2..37a9db414 100644
--- a/src/DocumentAccessor.h
+++ b/src/DocumentAccessor.h
@@ -35,7 +35,9 @@ public:
void Flush();
int GetLineState(int line);
int SetLineState(int line, int state);
- PropSet &GetPropSet() { return props; }
+ int GetPropertyInt(const char *key, int defaultValue=0) {
+ return props.GetInt(key, defaultValue);
+ }
void StartAt(unsigned int start, char chMask=31);
void SetFlags(char chFlags_, char chWhile_) {chFlags = chFlags_; chWhile = chWhile_; };
diff --git a/src/Editor.cxx b/src/Editor.cxx
index a4ac0be17..c00f08311 100644
--- a/src/Editor.cxx
+++ b/src/Editor.cxx
@@ -69,6 +69,7 @@ Editor::Editor() {
xOffset = 0;
xCaretMargin = 50;
+ horizontalScrollBarVisible = true;
currentPos = 0;
anchor = 0;
@@ -1275,6 +1276,10 @@ long Editor::FormatRange(bool draw, FORMATRANGE *pfr) {
return endPosPrint;
}
+// Empty method is overridden on GTK+ to show / hide scrollbars
+void Editor::ReconfigureScrollBars() {
+}
+
void Editor::SetScrollBarsTo(PRectangle) {
RefreshStyleData();
@@ -1818,6 +1823,9 @@ int Editor::KeyCommand(UINT iMessage) {
MovePositionTo(PositionFromLocation(
Point(lastXChosen, pt.y + vs.lineHeight)), true);
break;
+ case SCI_LINESCROLLDOWN:
+ ScrollTo(topLine + 1);
+ break;
case SCI_LINEUP:
MovePositionTo(PositionFromLocation(
Point(lastXChosen, pt.y - vs.lineHeight)));
@@ -1826,6 +1834,9 @@ int Editor::KeyCommand(UINT iMessage) {
MovePositionTo(PositionFromLocation(
Point(lastXChosen, pt.y - vs.lineHeight)), true);
break;
+ case SCI_LINESCROLLUP:
+ ScrollTo(topLine - 1);
+ break;
case SCI_CHARLEFT:
if (SelectionEmpty()) {
MovePositionTo(MovePositionSoVisible(currentPos - 1, -1));
@@ -3394,6 +3405,15 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
case SCI_GETLINEINDENTPOSITION:
return pdoc->GetLineIndentPosition(wParam);
+ case SCI_SETHSCROLLBAR :
+ horizontalScrollBarVisible = wParam;
+ SetScrollBars();
+ ReconfigureScrollBars();
+ break;
+
+ case SCI_GETHSCROLLBAR:
+ return horizontalScrollBarVisible;
+
case SCI_SETCODEPAGE:
pdoc->dbcsCodePage = wParam;
break;
@@ -3793,6 +3813,8 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
case SCI_LINETRANSPOSE:
case SCI_LOWERCASE:
case SCI_UPPERCASE:
+ case SCI_LINESCROLLDOWN:
+ case SCI_LINESCROLLUP:
return KeyCommand(iMessage);
case SCI_BRACEHIGHLIGHT:
@@ -3856,6 +3878,9 @@ LRESULT Editor::WndProc(UINT iMessage, WPARAM wParam, LPARAM lParam) {
SetSelection(currentPos, anchor); // Ensure selection inside document
return 0;
+ case SCI_SELECTIONISRECTANGLE:
+ return (selType == selRectangle) ? 1 : 0;
+
#ifdef MACRO_SUPPORT
case SCI_STARTRECORD:
recordingMacro = 1;
diff --git a/src/Editor.h b/src/Editor.h
index fe670ddd5..f4a9e12cd 100644
--- a/src/Editor.h
+++ b/src/Editor.h
@@ -64,6 +64,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
int xOffset; // Horizontal scrolled amount in pixels
int xCaretMargin; // Ensure this many pixels visible on both sides of caret
+ bool horizontalScrollBarVisible;
Surface pixmapLine;
Surface pixmapSelMargin;
@@ -189,6 +190,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
virtual void SetVerticalScrollPos() = 0;
virtual void SetHorizontalScrollPos() = 0;
virtual bool ModifyScrollBars(int nMax, int nPage) = 0;
+ virtual void ReconfigureScrollBars();
void SetScrollBarsTo(PRectangle rsClient);
void SetScrollBars();
diff --git a/src/KeyMap.cxx b/src/KeyMap.cxx
index a9a4adf33..0dd4ec088 100644
--- a/src/KeyMap.cxx
+++ b/src/KeyMap.cxx
@@ -63,8 +63,10 @@ UINT KeyMap::Find(int key, int modifiers) {
KeyToCommand KeyMap::MapDefault[] = {
{VK_DOWN, SCI_NORM, SCI_LINEDOWN},
{VK_DOWN, SCI_SHIFT, SCI_LINEDOWNEXTEND},
+ {VK_DOWN, SCI_CTRL, SCI_LINESCROLLDOWN},
{VK_UP, SCI_NORM, SCI_LINEUP},
{VK_UP, SCI_SHIFT, SCI_LINEUPEXTEND},
+ {VK_UP, SCI_CTRL, SCI_LINESCROLLUP},
{VK_LEFT, SCI_NORM, SCI_CHARLEFT},
{VK_LEFT, SCI_SHIFT, SCI_CHARLEFTEXTEND},
{VK_LEFT, SCI_CTRL, SCI_WORDLEFT},
diff --git a/src/LexCPP.cxx b/src/LexCPP.cxx
index 418c1133e..a1edec806 100644
--- a/src/LexCPP.cxx
+++ b/src/LexCPP.cxx
@@ -45,7 +45,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
styler.StartAt(startPos);
- bool fold = styler.GetPropSet().GetInt("fold");
+ bool fold = styler.GetPropertyInt("fold");
int lineCurrent = styler.GetLine(startPos);
int levelPrev = styler.LevelAt(lineCurrent) & SC_FOLDLEVELNUMBERMASK;
int levelCurrent = levelPrev;
@@ -177,7 +177,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
}
} else if (state == SCE_C_STRING) {
if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) {
- styler.ColourTo(i-1, state);
+ styler.ColourTo(i-1, SCE_C_STRINGEOL);
state = SCE_C_STRINGEOL;
} else if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
@@ -194,7 +194,7 @@ static void ColouriseCppDoc(unsigned int startPos, int length, int initStyle, Wo
}
} else if (state == SCE_C_CHARACTER) {
if ((ch == '\r' || ch == '\n') && (chPrev != '\\')) {
- styler.ColourTo(i-1, state);
+ styler.ColourTo(i-1, SCE_C_STRINGEOL);
state = SCE_C_STRINGEOL;
} else if (ch == '\\') {
if (chNext == '\"' || chNext == '\'' || chNext == '\\') {
diff --git a/src/LexPython.cxx b/src/LexPython.cxx
index 9552c0da6..84444bdff 100644
--- a/src/LexPython.cxx
+++ b/src/LexPython.cxx
@@ -60,8 +60,8 @@ static void ColourisePyDoc(unsigned int startPos, int length, int initStyle,
WordList &keywords = *keywordlists[0];
- bool fold = styler.GetPropSet().GetInt("fold");
- int whingeLevel = styler.GetPropSet().GetInt("tab.timmy.whinge.level");
+ bool fold = styler.GetPropertyInt("fold");
+ int whingeLevel = styler.GetPropertyInt("tab.timmy.whinge.level");
char prevWord[200];
prevWord[0] = '\0';
if (length == 0)
diff --git a/src/LexSQL.cxx b/src/LexSQL.cxx
index d7bcd81cf..83a22687e 100644
--- a/src/LexSQL.cxx
+++ b/src/LexSQL.cxx
@@ -41,7 +41,7 @@ static void ColouriseSQLDoc(unsigned int startPos, int length,
styler.StartAt(startPos);
- bool fold = styler.GetPropSet().GetInt("fold");
+ bool fold = styler.GetPropertyInt("fold");
int lineCurrent = styler.GetLine(startPos);
int spaceFlags = 0;