vishnugonela / editra

Automatically exported from code.google.com/p/editra
Other
0 stars 0 forks source link

Bold and italic can't be applied at the same time #127

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. open the Style Editor
2. select a style tag
3. click on bold and italic to make the font both bold and italic

What is the expected output? What do you see instead?

The checkboxes imply that a font can be made both bold and italic, but it
seems that only one thing can be applied at a time.  Clicking on bold turns
the style bold in the text preview, but then clicking on italic removes the
bold and turns it italic in the preview.  Actually, this goes for
underline, too -- whatever is most recently turned on seems to override
everything else.

IMPORTANT!!! Please answer these questions for any and ALL bug reports

What version of the product are you using? On what operating system?

svn on linux

What method of install was your version installed with (Binary/Source)?

svn

If from source: What version of python and wxPython are you using?

2.8.8.0

Please provide any additional information below.

Original issue reported on code.google.com by rob.mcmu...@gmail.com on 2 Jul 2008 at 5:47

GoogleCodeExporter commented 9 years ago

This issue in the style editor is caused by some optimization and behavior 
changes 
made to the Ess handling. Originally each tag was required to specify all 
attributes 
but the more recent behavior is that only the default tag needs to define all 
four 
attributes (fore, back, font, size) and all other tags with undefined 
attributes 
will inheirit from the default style. Ess is also designed to only allow for 
one 
extra style attribute to be appended to a given style tag specification.

i.e

keyword_style { 
        fore: #A52B2B bold;
}

When the style editor pulls this StyleItem 'keyword_style' it finds that it 
only has 
one attribute defined 'fore' and thus only one extra attribute 'bold' can be 
defined. So when a request for a new one comes in it removes the old one from 
that 
tag and adds the new one. For the StyleEditor to be able to work around this 
needs 
to insert another attribute (most likely copied from the default style) in 
order to 
house the second extra attribute.

i.e

keyword_style { 
        fore: #A52B2B bold;
        back: #FFFFFF italic;
}

When this happens and is translated into a StyleItem the styling will work as 
expected.

I believe there are some notes near the top of ed_style.py about redesigning 
the 
extra attribute handling. I have had some other ideas since then as well, I 
will try 
to get this fixed sometime soon.

For now in order to support multiple extra attributes you will need to edit the 
ess 
by hand to have the duplicate entries to hold the ex attributes.

Cody

Original comment by CodyPrec...@gmail.com on 2 Jul 2008 at 7:00

GoogleCodeExporter commented 9 years ago
Action Items:

1) Adapting parser to allow for multiple modifiers per style tag (done pending 
checkin)
2) Add concept of optional 'modfiers' attribute to style item to hold modifier 
values when a tag wishes to inheirit all styles but modifiers from 
default_style. 
(partially complete)
3) Adjust StyleEditor to handle these backend changes
4) Update stylesheet docs
5) Verify that no changes are necessary to existing style sheets (must maintain 
backwards compatibility).

Original comment by CodyPrec...@gmail.com on 30 Jul 2008 at 12:52

GoogleCodeExporter commented 9 years ago
Ok the changes in to make this work now have been made.

I haven't had much time to test for side effects of the changes made here, 
there will
likely be some that I need to weed out before the next release as the changes 
were
fairly major.

If you get a chance to test let me know.

Thanks,

Cody

(p.s Also the syntax modules have had some api additions recently to add more
features. They are capable of providing their own custom container lexers, and 
auto
indenter methods.)

Original comment by CodyPrec...@gmail.com on 31 Jul 2008 at 11:43

GoogleCodeExporter commented 9 years ago
I updated to the latest svn and gave it a try.  I tried changing the comment 
style to
bold + italic, which does show up correctly in the preview pane in the dialog. 
Exiting the dialog prompts me to save the new style, which I do and it shows in 
my
~/.Editra/styles/stuff.ess:

comment_style {
                fore:#838383;
                modifiers:bold italic;
}

But, in the editor, nothing has any bold or italic, not comments or any of the 
old
styles that used to have the modifiers -- it seems like everything but the 
colors has
been cleared.

Original comment by rob.mcmu...@gmail.com on 31 Jul 2008 at 3:51

GoogleCodeExporter commented 9 years ago
Sorry,

It looks like my last commit didn't go through before I left on vacation.

This should be working now.

Thanks,

Cody

Original comment by CodyPrec...@gmail.com on 5 Aug 2008 at 2:57

GoogleCodeExporter commented 9 years ago
cleaning up old 'fixed' issues

Original comment by CodyPrec...@gmail.com on 3 Feb 2009 at 6:41