The editor option "Interpret #if, #else, #endif to grey out inactive preprocessor-code" is on by default, but if it is disabled, that disabling is ignored when pasting code from one file to another.
In other words, even if I have the option disabled, when I paste a block of code from file a.cpp to file b.cpp, the inactive code becomes greyed out where it's pasted. Closing and reopening the file returns it to normal.
Is this still a valid bug? I can not reproduce this. Can someone give some exact steps?
I have just tested this further, and the issue seems to be nothing to do with pasting, but actually is when a new file is created in a particular way.
Steps to reproduce:
1. Create a new header file,
test.h
.2. Click
Edit
->Swap header & source
(or F11 shortcut).3. The file
test.cpp
does not exist, so you'll be prompted whether you want to create it. Do so.4. Any inactive preprocessor code you enter into this new file will now be greyed out, regardless of your preference setting. It only happens for this new file, and only until you close and reopen it.
Tested on SVN11217 on 64bit linux.
ok, i can reproduce and have found the culprit:
in editormanager.cpp:482
the new editor is created with the default paramter for the theme, but if we look how a file is opened in editormanager.cpp:390
we can see that a theme is passed to the function.
If i add a theme to the new function in editormanager.cpp:482
this works as expected
patch is attached
Nicely done.
Fix in trunk. Thanks for the contribution.