Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

SmartIndent refactoring question

(1/8) > >>

Alpha:
I noticed the recent addition of SmartIndent to the trunk (nice work :)), and was wondering, is there reasoning for the addition of cbSmartIndentPlugin::InComment() when cbStyledTextCtrl::IsComment() already exists?  The latter function determines what is a comment by using the values defined in the lexer_*.xml files.

It appears selection brace completion no longer works (under Ubuntu).

Also, the unix virtual target "All" does not actually contain all targets.

oBFusCATed:

--- Quote from: Alpha on October 01, 2012, 01:00:14 am ---It appears selection brace completion no longer works (under Ubuntu).

--- End quote ---
What do you mean by this? Example steps to reproduce?

Alpha:
Enable "Selection brace completion" under general editor settings.
Open a C++ source file.
Select a some text.
Type: "("

Select "line"

--- Code: ---test line

--- End code ---
After typing "(", the expected output (with selection brace completion) is:

--- Code: ---test (line)

--- End code ---
The actual output is:

--- Code: ---test (

--- End code ---

Alpha:
Oh, this is why; the activation logic has changed.

--- Code: ---Index: src/plugins/contrib/SmartIndent/CppSmartIndent.cpp
===================================================================
--- src/plugins/contrib/SmartIndent/CppSmartIndent.cpp (revision 8428)
+++ src/plugins/contrib/SmartIndent/CppSmartIndent.cpp (working copy)
@@ -74,7 +74,7 @@
 
     const wxChar ch = event.GetKey();
 
-    if ( SelectionBraceCompletionEnabled() )
+    if ( SelectionBraceCompletionEnabled() || stc->IsBraceShortcutActive() ) // the shortcut is Alt-I
         DoSelectionBraceCompletion(stc, ch);
 
     DoSmartIndent(ed, ch);
@@ -464,7 +464,7 @@
 
 void CppSmartIndent::DoSelectionBraceCompletion(cbStyledTextCtrl* control, const wxChar &ch)const
 {
-    if (( control->IsBraceShortcutActive()) && !control->GetLastSelectedText().IsEmpty())
+    if (!control->GetLastSelectedText().IsEmpty())
     {
 
         const int pos = control->GetCurrentPos();

--- End code ---

oBFusCATed:
Okay...

@devs: Shouldn't the options be separated, too? As far as I can see they are still at the old place.

@admins: please move the posts in the proper topic...

Navigation

[0] Message Index

[#] Next page

Go to full version