Hi,
please find attached an improved version of my patches.
As compared to the yesterday's version ...
1. the patch to "src/insets/insetlatexaccent.C" is not changed
2. the patch to "src/trans_mgr.C" is not changed
3. the patch to "src/text3.C" is improved in order to fix the problem with
\", which I have found today being the same as the one with <enter>
What concerns the patch 3. ... earlier today, in my previous email, I have
listed some special cases in the "src/text3.C", which explicitly call the
TransManager ... I have also mentioned that there are "combined" cases,
but I did not explicitly said what I meant ... I meant, for example,
places in the "src/text3.C", in the function LyXText::dispatch, where you
can find (recursive?) calls to "dispatch" and/or on-the-fly changes of the
"cmd" by the "FuncRequest" (if there is no call to "dispatch", you will
find a call to "undispatched()" in all such places).
Hope it helps,
Best regards,
Jacek.
===================================================================
--- ./src/insets/insetlatexaccent.C.000 2005-11-25 15:40:34.000000000 +0100
+++ ./src/insets/insetlatexaccent.C 2007-01-10 14:06:34.000000000 +0100
@@ -460,14 +460,16 @@
LColor::foreground);
break;
- case CARON: {
- int xp[3], yp[3];
- xp[0] = int(x2 - hg35); yp[0] = int(y + hg35);
- xp[1] = int(x2); yp[1] = int(y + hg);
- xp[2] = int(x2 + hg35); yp[2] = int(y + hg35);
- pi.pain.lines(xp, yp, 3, LColor::foreground);
- break;
- }
+ case CARON:
+ if (!contains("dlLt", ic)) {
+ int xp[3], yp[3];
+ xp[0] = int(x2 - hg35); yp[0] = int(y +
hg35);
+ xp[1] = int(x2); yp[1] = int(y + hg);
+ xp[2] = int(x2 + hg35); yp[2] = int(y +
hg35);
+ pi.pain.lines(xp, yp, 3, LColor::foreground);
+ break;
+ }
+ // fall through for Czech and Slovak characters "dlLt"
...
case SPECIAL_CARON: {
switch (ic) {
===================================================================
--- ./src/trans_mgr.C.000 2005-07-14 15:05:03.000000000 +0200
+++ ./src/trans_mgr.C 2007-01-15 15:56:52.000000000 +0100
@@ -13,6 +13,8 @@
#include "trans_mgr.h"
+#include "buffer.h"
+#include "language.h"
#include "BufferView.h"
#include "CutAndPaste.h"
#include "cursor.h"
@@ -22,6 +24,7 @@
#include "trans.h"
#include "insets/insetlatexaccent.h"
+#include "insets/insetert.h"
#include "support/lstrings.h"
@@ -289,6 +292,15 @@
lyx::cap::replaceSelection(cur);
cur.insert(new InsetLatexAccent(ins));
cur.posRight();
+ } else if ((str.size() > 1) && ((str[0] == '{') || (str[0] ==
'\\') || (str[0] == '$')) && (str[1] != ' ')) {
+ // str looks like a LaTeX code ... make an ERT out of
it ...
+ InsetERT * ert = new
InsetERT(text->bv()->buffer()->params(), InsetBase::Open);
+ LyXFont font(LyXFont::ALL_INHERIT, latex_language);
+ ert->setText(str, font);
+ LCursor & cur = text->bv()->cursor();
+ cur.insert(ert);
+ ert->setStatus(cur, InsetBase::Collapsed);
+ cur.posRight();
} else {
insertVerbatim(str, text);
}
===================================================================
--- ./src/text3.C.000 2006-09-14 15:50:37.000000000 +0200
+++ ./src/text3.C 2007-01-16 17:41:52.000000000 +0100
@@ -325,6 +325,18 @@
// Remember the old paragraph metric (_outer_ paragraph!)
Dimension olddim = cur.bottom().paragraph().dim();
+ // if <enter> or \" pressed after an <accent> ... kill the <accent> ...
+ switch (cmd.action) {
+ case LFUN_BREAKLINE:
+ case LFUN_BREAKPARAGRAPH:
+ case LFUN_BREAKPARAGRAPHKEEPLAYOUT:
+ case LFUN_BREAKPARAGRAPH_SKIP:
+ case LFUN_END_OF_SENTENCE:
+ case LFUN_QUOTE:
+ // combined_state_ -> deadkey_state_ -> init_state_
+ while (!(bv->owner()->getIntl().getTransManager().backspace()))
;
+ }
+
switch (cmd.action) {
case LFUN_APPENDIX: {