Patch #1715 2006-12-12 07:31
mcdave
Bugfix for bug:009641- Download
- 1715-Bugfix_for_bug.patch (32.5 KB)
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 3377)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -27,25 +27,25 @@
#include "sdk_precomp.h"
#ifndef CB_PRECOMP
- #include <wx/filename.h>
- #include <wx/notebook.h>
- #include <wx/wfstream.h>
+#include <wx/filename.h>
+#include <wx/notebook.h>
+#include <wx/wfstream.h>
- #include "cbeditor.h" // class's header file
- #include "globals.h"
- #include "sdk_events.h"
- #include "cbproject.h"
- #include "projectfile.h"
- #include "projectbuildtarget.h"
- #include "editorcolourset.h"
- #include "manager.h"
- #include "configmanager.h"
- #include "projectmanager.h"
- #include "pluginmanager.h"
- #include "editormanager.h"
- #include "messagemanager.h"
- #include "macrosmanager.h" // ReplaceMacros
- #include "cbplugin.h"
+#include "cbeditor.h" // class's header file
+#include "globals.h"
+#include "sdk_events.h"
+#include "cbproject.h"
+#include "projectfile.h"
+#include "projectbuildtarget.h"
+#include "editorcolourset.h"
+#include "manager.h"
+#include "configmanager.h"
+#include "projectmanager.h"
+#include "pluginmanager.h"
+#include "editormanager.h"
+#include "messagemanager.h"
+#include "macrosmanager.h" // ReplaceMacros
+#include "cbplugin.h"
#endif
#include <wx/fontutil.h>
@@ -71,14 +71,14 @@
#define DEBUG_STYLE wxSCI_MARK_ARROW
BEGIN_EVENT_TABLE(cbStyledTextCtrl, wxScintilla)
- EVT_CONTEXT_MENU(cbStyledTextCtrl::OnContextMenu)
- EVT_KILL_FOCUS(cbStyledTextCtrl::OnKillFocus)
- EVT_MIDDLE_DOWN(cbStyledTextCtrl::OnGPM)
+EVT_CONTEXT_MENU(cbStyledTextCtrl::OnContextMenu)
+EVT_KILL_FOCUS(cbStyledTextCtrl::OnKillFocus)
+EVT_MIDDLE_DOWN(cbStyledTextCtrl::OnGPM)
END_EVENT_TABLE()
cbStyledTextCtrl::cbStyledTextCtrl(wxWindow* pParent, int id, const wxPoint& pos, const wxSize& size, long style)
- : wxScintilla(pParent, id, pos, size, style),
- m_pParent(pParent)
+ : wxScintilla(pParent, id, pos, size, style),
+ m_pParent(pParent)
{
//ctor
}
@@ -117,7 +117,7 @@
#ifndef __WXGTK__
int pos = PositionFromPoint(wxPoint(event.GetX(), event.GetY()));
- if(pos == wxSCI_INVALID_POSITION)
+ if (pos == wxSCI_INVALID_POSITION)
return;
int start = GetSelectionStart();
@@ -125,7 +125,7 @@
wxString s = GetSelectedText();
- if(pos < GetCurrentPos())
+ if (pos < GetCurrentPos())
{
start += s.length();
end += s.length();
@@ -163,22 +163,21 @@
cbEditor* m_pOwner;
cbEditorInternalData(cbEditor* owner)
- : m_pOwner(owner),
- m_strip_trailing_spaces(true),
- m_ensure_final_line_end(false),
- m_ensure_consistent_line_ends(true),
- m_LastMarginMenuLine(-1),
- m_LastDebugLine(-1),
- m_useByteOrderMark(false),
- m_byteOrderMarkLength(0),
- m_lineNumbersWidth(0)
+ : m_pOwner(owner),
+ m_strip_trailing_spaces(true),
+ m_ensure_final_line_end(false),
+ m_ensure_consistent_line_ends(true),
+ m_LastMarginMenuLine(-1),
+ m_LastDebugLine(-1),
+ m_useByteOrderMark(false),
+ m_byteOrderMarkLength(0),
+ m_lineNumbersWidth(0)
{
m_encoding = wxLocale::GetSystemEncoding();
}
~cbEditorInternalData()
- {
- }
+ {}
// add member vars/funcs below
wxString GetEOLString() const
@@ -187,14 +186,14 @@
cbStyledTextCtrl* control = m_pOwner->GetControl();
switch (control->GetEOLMode())
{
- case wxSCI_EOL_LF:
- eolstring = _T("\n");
- break;
- case wxSCI_EOL_CR:
- eolstring = _T("\r");
- break;
- default:
- eolstring = _T("\r\n");
+ case wxSCI_EOL_LF:
+ eolstring = _T("\n");
+ break;
+ case wxSCI_EOL_CR:
+ eolstring = _T("\r");
+ break;
+ default:
+ eolstring = _T("\r\n");
}
return eolstring;
}
@@ -213,11 +212,11 @@
wxChar c = control->GetCharAt(--position);
int style = control->GetStyleAt(position);
bool inComment = style == wxSCI_C_COMMENT ||
- style == wxSCI_C_COMMENTDOC ||
- style == wxSCI_C_COMMENTDOCKEYWORD ||
- style == wxSCI_C_COMMENTDOCKEYWORDERROR ||
- style == wxSCI_C_COMMENTLINE ||
- style == wxSCI_C_COMMENTLINEDOC;
+ style == wxSCI_C_COMMENTDOC ||
+ style == wxSCI_C_COMMENTDOCKEYWORD ||
+ style == wxSCI_C_COMMENTDOCKEYWORDERROR ||
+ style == wxSCI_C_COMMENTLINE ||
+ style == wxSCI_C_COMME
download for full patch...
History
Sorry guys, I made a stupid error, here is the correct one!
Sorry guys, I made a stupid error, here is the correct one!
there's a side effect, not applying yet
Okay... side effects removed, I combined this patch with the patch of 001716. My tests confirmed it to be working... but hey... I am only human.
This also fixes bug nr: 009247 and 006965
A Small change ... but works better
Yippeee... this now works for all the fold levels... :)
I have tested this, and it works (all 3 bugs fixed). Congrats.
One little note : there's a little glitch in the sense that you see the fake editor being created. But I think we can live with that, normally one does not change the folding options that much.
I have modified the code (style) a very little bit.
Many thanks for the help.
revision : 3380