Improve documentation for conflict resolution
[TortoiseGit.git] / ext / scintilla / backgroundcolors.patch
blobad9a490bea9cf745f84b3de5179c3d72aeda8b3a
1 ext/scintilla/include/Scintilla.h | 1 +
2 ext/scintilla/src/EditView.cxx | 14 +++++++++++++-
3 ext/scintilla/src/EditView.h | 1 +
4 ext/scintilla/src/Editor.cxx | 1 +
5 ext/scintilla/src/Editor.h | 1 +
6 ext/scintilla/win32/ScintillaWin.cxx | 8 ++++++++
7 6 files changed, 25 insertions(+), 1 deletion(-)
9 diff --git a/ext/scintilla/include/Scintilla.h b/ext/scintilla/include/Scintilla.h
10 index b5c1c8f..9f8cf5d 100644
11 --- a/ext/scintilla/include/Scintilla.h
12 +++ b/ext/scintilla/include/Scintilla.h
13 @@ -1029,6 +1029,7 @@ typedef sptr_t (*SciFnDirect)(sptr_t ptr, unsigned int iMessage, uptr_t wParam,
14 #define SCN_HOTSPOTRELEASECLICK 2027
15 #define SCN_FOCUSIN 2028
16 #define SCN_FOCUSOUT 2029
17 +#define SCN_GETBKCOLOR 5000
18 /* --Autogenerated -- end of section automatically generated from Scintilla.iface */
20 /* These structures are defined to be exactly the same shape as the Win32
21 diff --git a/ext/scintilla/src/EditView.cxx b/ext/scintilla/src/EditView.cxx
22 index 6c26913..0d26631 100644
23 --- a/ext/scintilla/src/EditView.cxx
24 +++ b/ext/scintilla/src/EditView.cxx
25 @@ -46,6 +46,7 @@
26 #include "EditModel.h"
27 #include "MarginView.h"
28 #include "EditView.h"
29 +#include "Editor.h"
31 #ifdef SCI_NAMESPACE
32 using namespace Scintilla;
33 @@ -185,6 +186,7 @@ EditView::EditView() {
34 pixmapIndentGuideHighlight = 0;
35 llc.SetLevel(LineLayoutCache::llcCaret);
36 posCache.SetSize(0x400);
37 + editor = NULL;
40 EditView::~EditView() {
41 @@ -1623,7 +1625,17 @@ void EditView::DrawLine(Surface *surface, const EditModel &model, const ViewStyl
44 // See if something overrides the line background color.
45 - const ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
46 + ColourOptional background = vsDraw.Background(model.pdoc->GetMark(line), model.caret.active, ll->containsCaret);
47 + SCNotification scn = { 0 };
48 + scn.nmhdr.code = SCN_GETBKCOLOR;
49 + scn.line = line;
50 + scn.lParam = -1;
51 + if (editor)
52 + ((Editor*)editor)->NotifyParent(&scn);
53 + if (scn.lParam != -1) {
54 + background.Set(scn.lParam);
55 + background.isSet = true;
56 + }
58 const int posLineStart = model.pdoc->LineStart(line);
60 diff --git a/ext/scintilla/src/EditView.h b/ext/scintilla/src/EditView.h
61 index ceeb7ac..aad49ad 100644
62 --- a/ext/scintilla/src/EditView.h
63 +++ b/ext/scintilla/src/EditView.h
64 @@ -74,6 +74,7 @@ public:
65 Surface *pixmapLine;
66 Surface *pixmapIndentGuide;
67 Surface *pixmapIndentGuideHighlight;
68 + void *editor;
70 LineLayoutCache llc;
71 PositionCache posCache;
72 diff --git a/ext/scintilla/src/Editor.cxx b/ext/scintilla/src/Editor.cxx
73 index eb96689..add27c2 100644
74 --- a/ext/scintilla/src/Editor.cxx
75 +++ b/ext/scintilla/src/Editor.cxx
76 @@ -99,6 +99,7 @@ static inline bool IsAllSpacesOrTabs(const char *s, unsigned int len) {
79 Editor::Editor() {
80 + view.editor = this;
81 ctrlID = 0;
83 stylesValid = false;
84 diff --git a/ext/scintilla/src/Editor.h b/ext/scintilla/src/Editor.h
85 index 58e67a0..5558864 100644
86 --- a/ext/scintilla/src/Editor.h
87 +++ b/ext/scintilla/src/Editor.h
88 @@ -559,6 +559,7 @@ protected: // ScintillaBase subclass needs access to much of Editor
89 static sptr_t BytesResult(sptr_t lParam, const unsigned char *val, size_t len);
91 public:
92 + virtual void NotifyParent(SCNotification * scn) = 0;
93 // Public so the COM thunks can access it.
94 bool IsUnicodeMode() const;
95 // Public so scintilla_send_message can use it.
96 diff --git a/ext/scintilla/win32/ScintillaWin.cxx b/ext/scintilla/win32/ScintillaWin.cxx
97 index 2c6bab1..78584bb 100644
98 --- a/ext/scintilla/win32/ScintillaWin.cxx
99 +++ b/ext/scintilla/win32/ScintillaWin.cxx
100 @@ -264,6 +264,7 @@ class ScintillaWin :
101 virtual void SetCtrlID(int identifier);
102 virtual int GetCtrlID();
103 virtual void NotifyParent(SCNotification scn);
104 + virtual void NotifyParent(SCNotification * scn);
105 virtual void NotifyDoubleClick(Point pt, int modifiers);
106 virtual CaseFolder *CaseFolderForEncoding();
107 virtual std::string CaseMapString(const std::string &s, int caseMapping);
108 @@ -1662,6 +1663,13 @@ void ScintillaWin::NotifyParent(SCNotification scn) {
109 GetCtrlID(), reinterpret_cast<LPARAM>(&scn));
112 +void ScintillaWin::NotifyParent(SCNotification * scn) {
113 + scn->nmhdr.hwndFrom = MainHWND();
114 + scn->nmhdr.idFrom = GetCtrlID();
115 + ::SendMessage(::GetParent(MainHWND()), WM_NOTIFY,
116 + GetCtrlID(), reinterpret_cast<LPARAM>(scn));
119 void ScintillaWin::NotifyDoubleClick(Point pt, int modifiers) {
120 //Platform::DebugPrintf("ScintillaWin Double click 0\n");
121 ScintillaBase::NotifyDoubleClick(pt, modifiers);