Author Topic: Editor Tweaks plugin  (Read 22866 times)

Offline oBFusCATed

  • Developer
  • Lives here!
  • *****
  • Posts: 11939
    • Travis build status
Re: Editor Tweaks plugin
« Reply #15 on: April 25, 2012, 01:01:56 pm »
If it is in the main menu one can setup a key shortcut for it :)
(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 carra

  • Multiple posting newcomer
  • *
  • Posts: 114
Re: Editor Tweaks plugin
« Reply #16 on: April 25, 2012, 02:36:02 pm »
You are right... I learned about that AFTER my last post.

BTW: with the shortcut, my previous idea would work even better: you just press Ctrl+??, enter a character (or 2 at most, usually) and hit enter: done. Quite quick and totally flexible. No need to save configuration options, no large submenus.

Offline Kalith

  • Multiple posting newcomer
  • *
  • Posts: 67
Re: Editor Tweaks plugin
« Reply #17 on: November 25, 2012, 07:53:34 pm »
I didn't know about this plugin until quite recently when bug #18795 happened to me. It has been fixed now, but I still think that the plugin behaves strangely...

The default setting is to have "Editor caret buffer" (which is not a very explicit name, by the way) equal to 4, that is the plugin will try to always keep the caret 4 lines away from the borders of the view (at least that's what I think is the intended behavior).

The thing is, if you position the caret somewhere and scroll away so that it is no longer visible :
  • after typing a first character, the caret will be visible and located at the topmost/bottommost visible line
  • for each consequent character, the view will scroll one line at a time until the line on which the caret is positioned is the 4th visible line (or the n-4th one)
This is very confusing... But maybe this is intended behavior ?

Anyway, this is a quite an uncommon and undocumented feature, plus it is not clear how to disable it (Settings -> Editor -> EditorTweaks settings -> Editor caret buffer = None).

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Editor Tweaks plugin
« Reply #18 on: November 25, 2012, 07:56:40 pm »
Anyway, this is a quite an uncommon and undocumented feature, plus it is not clear how to disable it (Settings -> Editor -> EditorTweaks settings -> Editor caret buffer = None).
Thats just because you used recent nightlies where it was on by default. If you have a fresh installation, its off by default and won't harm unless you turn it on. Sorry for the inconvenience.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Kalith

  • Multiple posting newcomer
  • *
  • Posts: 67
Re: Editor Tweaks plugin
« Reply #19 on: November 25, 2012, 07:59:05 pm »
No worries, I was more concerned about C::B being at its best for the 12.11 release :)

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Editor Tweaks plugin
« Reply #20 on: November 26, 2012, 12:09:36 am »
Thats just because you used recent nightlies where it was on by default. If you have a fresh installation, its off by default and won't harm unless you turn it on.
Um... this feature is on by default.  I wrote it with a default 4 line buffer because that is what I personally found most useful.  However, from the sounds of various recent posts, this behavior is rather unexpected.  Would it be preferred if the default setting is a 1 line buffer (so the feature is still discoverable, but acts very conservatively, so it should not be too bothersome).  Or should it be off by default?  Or are there some other "4 line buffer supporters" out there who are remaining silent :)?

[...] This is very confusing... But maybe this is intended behavior ?
Intended, yes (well, sort of), but confusing, it seems also yes :-\.

It only scrolls one line at a time so a user's eyes do not (potentially) have to jump a great distance.  Unfortunately, this currently means 1 keypress == 1 line.
I have an idea for a smooth scroll to position, which would prevent the confusion of multiple scrolls when typing on the same line, but I do not know if this will make it into into the current release.  If the developers think it will be faster to just reduce the default setting, I would not want to delay this release with another patch.

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Editor Tweaks plugin
« Reply #21 on: November 26, 2012, 01:28:59 am »
Patch 3379 for smooth scroll is available, but no pressure to review it for this release.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Editor Tweaks plugin
« Reply #22 on: November 26, 2012, 06:28:24 am »
Um... this feature is on by default.  I wrote it with a default 4 line buffer because that is what I personally found most useful.
As always: Magic needs to be turned off by default. Standard (expected) behaviour is what should be enabled.

But didn't I change the default to be off in the commit?
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Editor Tweaks plugin
« Reply #23 on: November 26, 2012, 09:32:16 pm »
Magic down:
Code: [Select]
Index: src/plugins/contrib/EditorTweaks/EditorTweaksConfDlg.cpp
===================================================================
--- src/plugins/contrib/EditorTweaks/EditorTweaksConfDlg.cpp (revision 8624)
+++ src/plugins/contrib/EditorTweaks/EditorTweaksConfDlg.cpp (working copy)
@@ -26,7 +26,7 @@
     int maxSavedAlignerEntries = cfg->ReadInt(_T("/aligner/max_saved_entries"),4);
     SpinCtrl1->SetValue(maxSavedAlignerEntries);
 
-    Choice1->SetSelection(cfg->ReadInt(wxT("/buffer_caret"), 4));
+    Choice1->SetSelection(cfg->ReadInt(wxT("/buffer_caret"), 1));
 }
 
 EditorTweaksConfDlg::~EditorTweaksConfDlg()
@@ -44,7 +44,7 @@
     if(oldSavedAlignerEntries != newSavedAlignerEntries )
         cfg->Write(_T("aligner/max_saved_entries"),newSavedAlignerEntries);
 
-    const int oldBuffer = cfg->ReadInt(wxT("/buffer_caret"), 4);
+    const int oldBuffer = cfg->ReadInt(wxT("/buffer_caret"), 1);
     const int newBuffer = Choice1->GetSelection();
     if (oldBuffer != newBuffer)
         cfg->Write(wxT("/buffer_caret"), newBuffer);
Index: src/plugins/contrib/EditorTweaks/EditorTweaks.cpp
===================================================================
--- src/plugins/contrib/EditorTweaks/EditorTweaks.cpp (revision 8624)
+++ src/plugins/contrib/EditorTweaks/EditorTweaks.cpp (working copy)
@@ -1184,7 +1184,7 @@
 void EditorTweaks::DoBufferEditorPos(int delta)
 {
     if (m_buffer_caret == -1)
-        m_buffer_caret = Manager::Get()->GetConfigManager(wxT("EditorTweaks"))->ReadInt(wxT("/buffer_caret"), 4);
+        m_buffer_caret = Manager::Get()->GetConfigManager(wxT("EditorTweaks"))->ReadInt(wxT("/buffer_caret"), 1);
     if (m_buffer_caret < 1) // feature disabled (selected "None" in settings)
         return;
     cbEditor* ed = Manager::Get()->GetEditorManager()->GetBuiltinActiveEditor();

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Editor Tweaks plugin
« Reply #24 on: November 27, 2012, 06:27:46 am »
Magic down:
It was really by default at 4? Well this is going to be fun with the release then... 8)
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: Editor Tweaks plugin
« Reply #25 on: November 27, 2012, 07:34:07 am »
hhm, if in the release it is not default off, we need to rebuild, really, this is a non normal situation. We don't want to scare users away (it is ok we use ubuntu numbering, but we should not take over ubuntu attitude)  :P

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9496
Re: Editor Tweaks plugin
« Reply #26 on: November 27, 2012, 08:41:21 am »
hhm, if in the release it is not default off, we need to rebuild, really, this is a non normal situation.
Are you serious? Actually we can't do that - you know...
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: Editor Tweaks plugin
« Reply #27 on: November 27, 2012, 09:56:28 am »
I am serious yes, I also ran into this, and it is strange when you are not used to it, and most people , I think, are not used to such a thing. I want to avoid to annoy users which such things. And if rebuilding is the only thing we should do, well let's do it. It is not fun, but it is because we made a mistake to make this the default in the first place, we should pay for our mistakes, not the user. And since Jens is most of all affected, he should come to Brussels and I will bribe him with Belgian beers  ;D
Others also welcome to come over for beers  :D

Offline Alpha

  • Developer
  • Lives here!
  • *****
  • Posts: 1513
Re: Editor Tweaks plugin
« Reply #28 on: November 27, 2012, 11:30:08 pm »
It is not fun, but it is because we made a mistake to make this the default in the first place, we should pay for our mistakes, not the user.
I was the one who made the mistake, not any of you.
I guess I will now have to go write some more code for the patch tracker, to say sorry ;).

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5177
Re: Editor Tweaks plugin
« Reply #29 on: November 28, 2012, 07:29:43 am »
we are a group, so WE made the mistake. Mistakes happen, so don't worry, what matters is how we solve them, and try to avoid them.