From c2f68fd01dd35b3cedaeffc2351c5d7a37f71a84 Mon Sep 17 00:00:00 2001 From: Jean-Marc Lasgouttes Date: Tue, 29 May 2001 12:54:33 +0000 Subject: [PATCH] fix insetexternal read; fix numpad Enter key git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/branches/BRANCH_1_1_6@2054 a592a061-630c-0410-9148-cb99ea01b6c8 --- ChangeLog | 11 +++++++++++ lib/bind/xemacs.bind | 2 +- src/insets/insetexternal.C | 21 +++++++++++++++++++-- src/lyx_main.C | 2 +- 4 files changed, 32 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e3f4a3dd7..a07956f417 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2001-05-29 Jean-Marc Lasgouttes + + * src/insets/insetexternal.C (Read): the reading of external + insets now checks for \end_inset and removes it form the input + stream. + + * src/lyx_main.C (defaultKeyBindings): change default binding of + KP_Enter. + + * lib/bind/xemacs.bind: add ~S to a binding using asciitilde + 2001-05-27 Dekel Tsur * src/LaTeX.C (deplog): Make sure that the main .tex file is in the diff --git a/lib/bind/xemacs.bind b/lib/bind/xemacs.bind index f964fd6e2a..e3ecda30e9 100644 --- a/lib/bind/xemacs.bind +++ b/lib/bind/xemacs.bind @@ -253,7 +253,7 @@ \bind "C-c C-f C-r" "font-roman" \bind "C-c C-f C-t" "font-code" #typewriter -\bind "C-c asciitilde" "math-mode" +\bind "C-c ~S-asciitilde" "math-mode" \bind "C-c quoteleft" "error-next" diff --git a/src/insets/insetexternal.C b/src/insets/insetexternal.C index b15178ee38..cff94457df 100644 --- a/src/insets/insetexternal.C +++ b/src/insets/insetexternal.C @@ -325,8 +325,25 @@ void InsetExternal::Write(Buffer const *, std::ostream & os) const void InsetExternal::Read(Buffer const *, LyXLex & lex) { - lex.EatLine(); - string const format = lex.GetString(); + string format; + string token; + + // Read inset data from lex and store in format + if (lex.EatLine()) { + format = lex.GetString(); + } else + lex.printError("InsetExternal: Parse error: `$$Token'"); + while (lex.IsOK()) { + lex.nextToken(); + token = lex.GetString(); + if (token == "\\end_inset") + break; + } + if (token != "\\end_inset") { + lex.printError("Missing \\end_inset at this point. " + "Read: `$$Token'"); + } + string::size_type const pos1 = format.find(","); templatename = format.substr(0, pos1); string::size_type const pos2 = format.find("\",\"", pos1); diff --git a/src/lyx_main.C b/src/lyx_main.C index b39866318f..d1013b9a3d 100644 --- a/src/lyx_main.C +++ b/src/lyx_main.C @@ -483,7 +483,7 @@ void LyX::defaultKeyBindings(kb_keymap * kbmap) // e.g. Num Lock set kbmap->bind("KP_0", LFUN_SELFINSERT); kbmap->bind("KP_Decimal", LFUN_SELFINSERT); - kbmap->bind("KP_Enter", LFUN_SELFINSERT); + kbmap->bind("KP_Enter", LFUN_BREAKPARAGRAPH); kbmap->bind("KP_1", LFUN_SELFINSERT); kbmap->bind("KP_2", LFUN_SELFINSERT); kbmap->bind("KP_3", LFUN_SELFINSERT);