What is it?
* Temporarily change Word wrap, Line numbers, Tab and EOL handling settings per editor.
* Disables insert key
Uses
* Opened a text file that doesn't use doesn't use newlines in paragraphs? Solution: switch on word wrap without interfering with other open editors
* On windows working with windows sources, but opened a source file with unix newlines? Solution use the EOL tweaks to get the behavior you need for that file without interfering with your other editors.
Source code:
svn checkout http://svn.berlios.de/svnroot/repos/cbilplugin/branches/EditorTweaks
Binaries:
attached
Todo:
1. Use the main menu instead of the popup menu.
2. Implement "Strip Trailing Blanks Now"
3. Make disabling of insert key optional
Screenshot attached
win32 plugin binary attached (built against Nov 2009 nightly build)
The plugin is now one of the contrib plugins in the offical Code::Blocks repository (and has additional features)
[attachment deleted by admin]
Quote from: dmoore on December 09, 2009, 10:58:23 PM
1. Use the main menu instead of the popup menu.
Done.
added fold/unfold above level
added win32 plugin binary (see first post)
@dmoore
can you change the output path,so I don't need to copy the output to the cb relatived folder by myself but use cmd. :D
as in ../../../devel/share/codeblocks/plugins/LIBNAME? I guess so.
Right now it defaults to building a cbplugin (which is the C::B plugin template default). so maybe I'll just add a second target to handle this case.
Hi guys, I am new to Cb .I am trying to install the editor tweak plugin and found
that the binaries have been removed.I did the svn checkout and found only the
source files.Could you help me to install it?
Yes, use a nightly build :)
Or tell us your OS so we can guide you to build C::B from source.
Cyberdine: Some time back the plugin was moved into the official C::B repository and is one of the "contrib" plugins. Apologies for not updating this post.
obfuscated:
I am using Ubuntu 11.04 and the code I checked out was for the plugin and not for CB coz I wasnt
clear with my last post.
dmoore:
Do you mean to say that the plugin has been integrated to the repo of CB?
Thanks guys
Yes, the code is in svn.
We have nightly build for ubuntu, too. See here for details: http://apt.jenslody.de/
Hello, I would like to report a bug in the Aligner feature (very useful, by the way!) of Editor Tweaks.
I am now using a fresh copy of prebuilt Nightly build 7925 for Windows version. I have tested this on 2 machines, Vista and XP and the same happens.
Right after install, the Aligner option of the context menu provides 4 default alignment options, and lets the user create more of its own. This works fine: after creating them, the aligner menu shows all existing options and they work.
The bug comes when restarting C::B. It seems that the menu always loads only 4 entries. I have verified that even when default.conf contains more entries, the menu always shows only 4, and they may not be the default ones. Not a critical bug, but rather annoying!
Quote from: carra on April 24, 2012, 08:40:35 PM
the menu always shows only 4, and they may not be the default ones. Not a critical bug, but rather annoying!
It is hard coded in EditorTweaks.cpp:
const unsigned int MaxStoreAlignerdEntries = 4;
The reason might be that
dmoore didn't want to clutter the editor menu too much.However, if you compile C::B yourself you can just change the value (or use one of the first 4 entries ;))
Well I don't compile C::B so I will have to use it as it is. It does seem weird though, that you are given the option to create more, and the code doesn't take this into account.
As an idea: If we don't want to clutter menu options, a better way to do this would be to not provide submenus: instead, just pop up an input box where you enter the character to be used for alignment in each use. This would be fast and practical, since in most cases it will be a single keystroke.
Another problem is that the Aligner menu is missing from the main menu.
Yeah, it is certainly not there. I did not even know that it was supposed to be there!
Well it seems to me much quicker to use the context menu, but it won't hurt if the option is in the main menu as well.
If it is in the main menu one can setup a key shortcut for it :)
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.
I didn't know about this plugin until quite recently when bug #18795 (http://developer.berlios.de/bugs/?func=detailbug&bug_id=18795&group_id=5358) 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).
Quote from: Kalith on November 25, 2012, 07:53:34 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.
No worries, I was more concerned about C::B being at its best for the 12.11 release :)
Quote from: MortenMacFly on November 25, 2012, 07:56:40 PM
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 :)?
Quote from: Kalith on November 25, 2012, 07:53:34 PM
[...] 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.
Patch 3379 (http://developer.berlios.de/patch/index.php?func=detailpatch&patch_id=3379&group_id=5358) for smooth scroll is available, but no pressure to review it for this release.
Quote from: Alpha on November 26, 2012, 12:09:36 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?
Magic down:
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();
Quote from: Alpha on November 26, 2012, 09:32:16 PM
Magic down:
It was really by default at 4? Well this is going to be fun with the release then... 8)
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
Quote from: killerbot 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.
Are you serious? Actually we can't do that - you know...
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
Quote from: killerbot on November 27, 2012, 09:56:28 AM
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 ;).
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.
I don't know if this is related, but the current nightly build doesn't really remember my setting for this particular feature.
The value is correctly saved (for example if I choose "None", then "Settings -> Editor -> EditorTweaks settings -> Editor caret buffer" correctly shows "None" after restarting C::B), but not properly restored : after a fresh restart of C::B, the plugin behaves as if "Center carret" was selected. I have to change the setting to some other value, and change it back to "None" for it to be disabled correctly.
Quote from: Kalith on November 29, 2012, 11:51:41 AM
I don't know if this is related, but the current nightly build doesn't really remember my setting for this particular feature.
[...]
Quote from: Alpha on November 26, 2012, 01:20:41 AM
Quote from: Sagaceil on November 26, 2012, 12:40:07 AM
I'm just downloaded RC2 vesrion, and I noticed, that when I'm putting new charcters or delete them from to top most or bottom lines in current view in editor, whole tekst scrolls in direction to achive active line as close to middle as it can be. It happens every typed key in the new opened file. It may stop for a while but it comes back in non determistic moment ;)
Quote from: MortenMacFly on November 23, 2012, 11:40:48 PM
Quote from: Alpha on November 23, 2012, 08:33:03 PM
As a warning, the annoyance may have been removed, but the position buffering settings are not loaded until the settings window is opened (at least once) due to a missing initialization (http://forums.next.codeblocks.org/index.php/topic,17070.msg117249.html#msg117249).
Done in trunk.
Sorry, RC2 is rev 8598, but the missing initialization was fixed in rev 8599 (fix arrived one commit too late :(). This means that in RC2, this one setting (for buffering the caret position in the editor) is a random number at startup, and only reads your config when the editor settings window is opened.
You may want to disable the EditorTweaks plugin until you either create your own build from the trunk, or the next RC is released.
RC2 does remember your settings, it just does not read the config file until the editor settings window is open (this bug is already fixed in the trunk).
Nice, thank you :)