Home » U++ TheIDE » U++ TheIDE: Other Features Wishlist and/or Bugs » tabs settings in editor not honoured
tabs settings in editor not honoured [message #25437] |
Tue, 23 February 2010 16:20  |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
The settings concerning indentation and tabs for the editor in theIDE are often lost (you set them and after restarting or setting another main package, they are reset to their default values of 4 spaces and using tab characters for indentation).
Moreover; when you check the setting to use spaces for indentations, still tab characters are used.
This was observed on windows vista 32bit using U++ r2083.
2010-03-14: Hmm; looking at the sources, it seems normal that these settings are saved per package. Strange; does anyone really want different tab settings per package? And the other problem I mentioned is because I expected the tab key to follow the settings and use spaces as well. Also looking at the sources, this seems not to be the case.
Anyway, I created a diff file to apply this changed tab-key behaviour locally for my own builds and, if you are interested, I am happy to send it.
[Updated on: Sun, 14 March 2010 12:04] Report message to a moderator
|
|
|
Re: tabs settings in editor not honoured [message #26183 is a reply to message #25437] |
Fri, 09 April 2010 01:57   |
|
Hi frankdeprins,
I experience (probably) the same thing with some other settings too. In number of colors for scope highlighting, and all the setting in Editor and IDE tabs of Environment dialogue...
I agree that most of these settings should be set globaly, not per package. Or if they are really pacakge specific, they should be set somewhere else, but not in IDE environment. Could you post your patch here, please?
Regards,
Honza
|
|
|
Re: tabs settings in editor not honoured [message #26746 is a reply to message #26183] |
Tue, 25 May 2010 15:07   |
frankdeprins
Messages: 99 Registered: September 2008 Location: Antwerp - Belgium
|
Member |
|
|
Sorry for the late reply; I did not return to this thread anymore.
Here is the patch I apply:
Index: .\uppsrc\CodeEditor\CodeEditor.cpp
=========================================================
--- .\uppsrc\CodeEditor\CodeEditor.cpp Tue Feb 09 16:34:06 2010
+++ ..\Modified\uppsrc\CodeEditor\CodeEditor.cpp Thu Mar 04 11:53:04 2010
@@ -868,8 +868,11 @@
IndentInsert(code);
return true;
}
- if(code == 9 && IsSelection())
+ if(code == 9)
+ if (IsSelection())
return true;
+ else if (indent_spaces)
+ return LineEdit::Key(32, indent_amount);
}
if(GetCharset() != CHARSET_UTF8)
if(code >= 128 && code < 65536 && FromUnicode((wchar)code, GetCharset()) == DEFAULTCHAR)
This patch does not change the package specific character of the setting. What it does is change the behaviour of the tab key: if you have set 'indent using spaces' on, the tab key will also use spaces when pressed instead of a tab character. Unless for a selection.
Beware that I am quite new in investigating the U++ sources and I would not recommend applying this patch to the repository without a proper review. That said, it works fine for me.
Here is another one that sets 'indent using spaces' as default as well as a space count of 3 for indents. This is how I like it, please edit as you want it.
Index: .\uppsrc\ide\idewin.cpp
=========================================================
--- .\uppsrc\ide\idewin.cpp Mon Feb 22 09:31:30 2010
+++ ..\Modified\uppsrc\ide\idewin.cpp Thu Mar 04 10:31:35 2010
@@ -530,9 +530,9 @@
tfont = editorfont = font2 = Courier(13);
veditorfont = consolefont = font1 = Courier(11);
- editortabsize = 4;
- indent_amount = 4;
- indent_spaces = false;
+ editortabsize = 3;
+ indent_amount = 3;
+ indent_spaces = true;
show_status_bar = false;
show_tabs = false;
tabs_icons = false;
[Updated on: Tue, 25 May 2010 16:12] Report message to a moderator
|
|
|
Re: tabs settings in editor not honoured [message #26794 is a reply to message #26183] |
Fri, 28 May 2010 14:45   |
 |
mirek
Messages: 14255 Registered: November 2005
|
Ultimate Member |
|
|
dolik.rce wrote on Thu, 08 April 2010 19:57 | Hi frankdeprins,
I experience (probably) the same thing with some other settings too. In number of colors for scope highlighting, and all the setting in Editor and IDE tabs of Environment dialogue...
I agree that most of these settings should be set globaly, not per package. Or if they are really pacakge specific, they should be set somewhere else, but not in IDE environment. Could you post your patch here, please?
Regards,
Honza
|
If you change tab settings in "File properties", it gets stored into package (for the specific files). It has nothing to do with Environment settings of tab.
Anyway, it is true that some settings are getting stored on per-package basis, although not into the package (in fact, it is per "main-package-and-assembly" basis).
There are two serialization functions:
void Ide::SerializeWorkspace(Stream& s);
and
void Ide::Serialize(Stream& s);
First one contains things supposed to be serialized per package, second global things.
Now, if you feel that something should be moved from SerializeWorkspace to Serialize (or in opposite direction), just suggest 
Mirek
|
|
|
|
Goto Forum:
Current Time: Sat Apr 26 14:47:47 CEST 2025
Total time taken to generate the page: 0.01067 seconds
|