Juergen Spitzmueller wrote:
Richard Heck wrote:
The difficulty is that, if you're already in the inset, you might be
wanting to apply another one. How do you distinguish that from changing
the inset type (which is the most natural thing).
Some thoughts: Say I have a charstyle <foo>hello world</foo>.
* If I select "hello" and select "bar" from the combo, the result would be a
nested construct "<foo><bar>hello</bar> world</foo>".
* If I want to get rid of "foo", I select "hello world" and select "none"
from the combo (which "dissolves" the inset)
* If I select "hello" and chose "none", the result would be "hello<foo>
world</foo>".
* If I select "o wo" and select "none", the expected result would
be "<foo>hell</foo>o wo<foo>rld</foo>". This might be tricky to implement,
but it's needed.
I wouldn't think this was too bad. Behind the scenes, you just dissolve
the inset and then create two new ones using the non-selected text. The
trickier case would be if it were possible, in a case like this:
<foo>Some <bar>words</bar> here</foo>
to select "s</bar> he". I think this should be permitted, ideally, since
you might want to delete exactly those characters. If you do that and
choose "too", then probably you should get:
<foo>Some <bar>word<too>s</too></bar><too> he</too>re</foo>
But maybe the combo box just should refuse to participate.
This is not the best case for insets. But it's also not clear how to
make sense of this semantically.
* I'm not sure yet what should happen if you select "hello world" and
chose "bar". It might be expected to get <foo><bar>hello world</bar></foo>,
and this should be possible. OTOH some people might expect (for some
specific insets) that foo is replaced by "bar", i.e. "<bar>hello
world</bar>". But in the end, they might to reset the inset first, or we
define some "mutually exclusive" types of insets (the math color problem).
Does this make sense?
Yes, sorry, I wasn't thinking in terms of selections. But I'd add, for
simplicity: If you're in an inset and, even without a selection, choose
"None", that dissolves it. There should be an easy way to do that.
Richard