Author Topic: SmartIndent refactoring question  (Read 30069 times)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
SmartIndent refactoring question
« on: October 01, 2012, 01:00:14 am »
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.

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #1 on: October 01, 2012, 01:05:56 am »
It appears selection brace completion no longer works (under Ubuntu).
What do you mean by this? Example steps to reproduce?
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: SmartIndent refactoring question
« Reply #2 on: October 01, 2012, 01:20:52 am »
Enable "Selection brace completion" under general editor settings.
Open a C++ source file.
Select a some text.
Type: "("

Select "line"
Code
test line
After typing "(", the expected output (with selection brace completion) is:
Code
test (line)
The actual output is:
Code
test (

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: SmartIndent refactoring question
« Reply #3 on: October 01, 2012, 01:42:54 am »
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();
« Last Edit: October 01, 2012, 01:44:31 am by Alpha »

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #4 on: October 01, 2012, 01:45:16 am »
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...
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: SmartIndent refactoring question
« Reply #5 on: October 01, 2012, 10:29:08 am »
Oh, this is why; the activation logic has changed.
Oh - good catch. Maybe danselmi can check and apply... I'll try myself.

@devs: Shouldn't the options be separated, too? As far as I can see they are still at the old place.
Probably. I think its a matter of taste.

@admins: please move the posts in the proper topic...
To what? I think "Development" fits quite well...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #6 on: October 01, 2012, 10:48:10 am »
Probably. I think its a matter of taste.
What happens if the plugins is not loaded?

To what? I think "Development" fits quite well...
I forgot that the other topic is not visible :(
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline danselmi

  • Developer
  • Almost regular
  • *****
  • Posts: 203
Re: SmartIndent refactoring question
« Reply #7 on: October 01, 2012, 09:21:25 pm »
...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.
I will look into it. Give me some time.
It appears selection brace completion no longer works (under Ubuntu).
Fixed in 8429.

@devs: Shouldn't the options be separated, too? As far as I can see they are still at the old place.
I already thought about this problem. Which plugin should provide these options? Every one its own dialog with near the same choices (Cpp, fortran, python...)?

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #8 on: October 01, 2012, 09:59:34 pm »
I already thought about this problem. Which plugin should provide these options? Every one its own dialog with near the same choices (Cpp, fortran, python...)?
What about adding a Settings->Editor->Smart Indent page. Then at the top a drop-down would be used to switch between all the implementations.
The implementations can provide their own gui, when they are selected in the drop-down.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #9 on: November 04, 2012, 05:19:31 pm »
Code
Invalid manifest file for: LuaSmartIndent
Invalid manifest file for: CppSmartIndent

Anyone seeing this in the log? And both Lua and Cpp plugins are not loaded, nor are visible in the Plugins->Manage... dialog.

This is on linux using the autotools build system, rev 8500, but I'm seeing this for a while now.

p.s. can someone rename the plugins to SmartIndentXXX instead of XXXSmartIndent
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline Jenna

  • Administrator
  • Lives here!
  • *****
  • Posts: 7255
Re: SmartIndent refactoring question
« Reply #10 on: November 04, 2012, 06:00:03 pm »
Code
Invalid manifest file for: LuaSmartIndent
Invalid manifest file for: CppSmartIndent

Anyone seeing this in the log? And both Lua and Cpp plugins are not loaded, nor are visible in the Plugins->Manage... dialog.

This is on linux using the autotools build system, rev 8500, but I'm seeing this for a while now.

p.s. can someone rename the plugins to SmartIndentXXX instead of XXXSmartIndent

Works fine here with the build from my fedora-repo (8500).
It was build with autotools in a clean environment (mock).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: SmartIndent refactoring question
« Reply #11 on: November 04, 2012, 06:37:57 pm »
Works fine here with the build from my fedora-repo (8500).
On Windows here, too. Just tried - but I did a completely clean build, too. Are these files present at all in you copy? Maybe they could not be copied (remember: in the build process they are all being copied from "luamanifest.xml" to "manifest.xml" or alike... I don't recall exactly...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #12 on: November 04, 2012, 06:43:08 pm »
Last time I've checked there was some mess happening. I'll check again.
The build is 100% clean, because it is done by emerge/portage in a new directory, should be 100% reliable.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5491
Re: SmartIndent refactoring question
« Reply #13 on: November 04, 2012, 10:30:42 pm »
I think I reported this some weeks ago, this pops up all the time, I think the only time (and not even sure) I got rid of this, was a full bootstrap - configure - make process. (On linux). Since then I have switched to ignore phase :-(

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 13413
    • Travis build status
Re: SmartIndent refactoring question
« Reply #14 on: November 04, 2012, 11:35:24 pm »
I've removed the svn checkout for emerge and it gone away... pretty strange...

But still someone should rename the plugins to be a more closer together in the UI.
(most of the time I ignore long posts)
[strangers don't send me private messages, I'll ignore them; post a topic in the forum, but first read the rules!]