Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 6196)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -404,10 +404,11 @@
const wxString rightBrace(_T(")]}"));
int index = leftBrace.Find(ch);
const wxString unWant(_T(");\n\r\t\b "));
+ wxChar nextChar = control->GetCharAt(pos);
#if wxCHECK_VERSION(2, 9, 0)
- if ((index != wxNOT_FOUND) && (unWant.Find(wxUniChar(control->GetCharAt(pos))) != wxNOT_FOUND))
+ if ((index != wxNOT_FOUND) && (unWant.Find(wxUniChar(nextChar)) != wxNOT_FOUND) || nextChar == _T('\0'))
#else
- if ((index != wxNOT_FOUND) && (unWant.Find(control->GetCharAt(pos)) != wxNOT_FOUND))
+ if ((index != wxNOT_FOUND) && (unWant.Find(nextChar) != wxNOT_FOUND) || nextChar == _T('\0'))
#endif
{
control->AddText(rightBrace.GetChar(index));
Bug reproduce:
1. Create project, open the main.cpp, and delete ALL the characters. (Ctrl + A, Delete)
2. Pressing '(', will find no match.
[attachment deleted by admin]
Maybe need change:
if ((index != wxNOT_FOUND) && (unWant.Find(nextChar) != wxNOT_FOUND) || nextChar == _T('\0'))
TO:
if (((index != wxNOT_FOUND) && (unWant.Find(nextChar) != wxNOT_FOUND)) || nextChar == _T('\0'))
?
[attachment deleted by admin]
Cool! I think that's the final reason.
Index: src/sdk/cbeditor.cpp
===================================================================
--- src/sdk/cbeditor.cpp (revision 6197)
+++ src/sdk/cbeditor.cpp (working copy)
@@ -404,10 +404,11 @@
const wxString rightBrace(_T(")]}"));
int index = leftBrace.Find(ch);
const wxString unWant(_T(");\n\r\t\b "));
+ wxChar nextChar = control->GetCharAt(pos);
#if wxCHECK_VERSION(2, 9, 0)
- if ((index != wxNOT_FOUND) && (unWant.Find(wxUniChar(control->GetCharAt(pos))) != wxNOT_FOUND))
+ if (index != wxNOT_FOUND && (unWant.Find(wxUniChar(nextChar)) != wxNOT_FOUND || nextChar == _T('\0')))
#else
- if ((index != wxNOT_FOUND) && (unWant.Find(control->GetCharAt(pos)) != wxNOT_FOUND))
+ if (index != wxNOT_FOUND && (unWant.Find(nextChar) != wxNOT_FOUND || nextChar == _T('\0')))
#endif
{
control->AddText(rightBrace.GetChar(index));
[attachment deleted by admin]
applied
Hi, killerbot, I think it should be change to :
#if wxCHECK_VERSION(2, 9, 0)
if ((index != wxNOT_FOUND) && ((unWant.Find(wxUniChar(nextChar)) != wxNOT_FOUND) || (pos == control->GetLength())))
#else
if ((index != wxNOT_FOUND) && ((unWant.Find(nextChar) != wxNOT_FOUND) || (pos == control->GetLength())))
#endif
What do you think?