mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-25 22:06:15 +00:00
fix some keybindings, fix dead_keys, autoregion_delete and math greek
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2023 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
c1d014c261
commit
a02eed7a3f
@ -1,3 +1,11 @@
|
|||||||
|
2001-05-23 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
|
* bind/latinkeys.bind: set quotedbl to quote-insert, set
|
||||||
|
nobreakspace to protected-space-insert
|
||||||
|
|
||||||
|
* bind/emacs.bind: set C-j to break-paragraph, set C-t to
|
||||||
|
chars-transpose.
|
||||||
|
|
||||||
2001-05-22 Adrien Rebollo <rebollo@iaf.cnrs-gif.fr>
|
2001-05-22 Adrien Rebollo <rebollo@iaf.cnrs-gif.fr>
|
||||||
|
|
||||||
* lib/kbd/european.kmap:
|
* lib/kbd/european.kmap:
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
# help in emacs
|
# help in emacs
|
||||||
\bind "C-h" "hyphenation-point-insert"
|
\bind "C-h" "hyphenation-point-insert"
|
||||||
\bind "C-i" "hfill-insert"
|
\bind "C-i" "hfill-insert"
|
||||||
#bind "C-j" "------"
|
\bind "C-j" "break-paragraph"
|
||||||
\bind "C-k" "line-delete-forward"
|
\bind "C-k" "line-delete-forward"
|
||||||
\bind "C-l" "screen-recenter"
|
\bind "C-l" "screen-recenter"
|
||||||
\bind "C-m" "mark-toggle"
|
\bind "C-m" "mark-toggle"
|
||||||
@ -47,8 +47,7 @@
|
|||||||
\bind "C-s" "find-replace"
|
\bind "C-s" "find-replace"
|
||||||
\bind "M-~S-percent" "find-replace"
|
\bind "M-~S-percent" "find-replace"
|
||||||
|
|
||||||
# should be "chars-transpose" (swaps two chars)
|
\bind "C-t" "chars-transpose"
|
||||||
#bind "C-t" "------"
|
|
||||||
|
|
||||||
# universal argument in emacs
|
# universal argument in emacs
|
||||||
\bind "C-u" "font-underline"
|
\bind "C-u" "font-underline"
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
|
|
||||||
\bind "space" "self-insert"
|
\bind "space" "self-insert"
|
||||||
\bind "exclam" "self-insert"
|
\bind "exclam" "self-insert"
|
||||||
\bind "quotedbl" "self-insert"
|
\bind "quotedbl" "quote-insert"
|
||||||
\bind "numbersign" "self-insert"
|
\bind "numbersign" "self-insert"
|
||||||
\bind "dollar" "self-insert"
|
\bind "dollar" "self-insert"
|
||||||
\bind "percent" "self-insert"
|
\bind "percent" "self-insert"
|
||||||
@ -99,7 +99,7 @@
|
|||||||
\bind "braceright" "self-insert"
|
\bind "braceright" "self-insert"
|
||||||
\bind "asciitilde" "self-insert"
|
\bind "asciitilde" "self-insert"
|
||||||
|
|
||||||
\bind "nobreakspace" "self-insert"
|
\bind "nobreakspace" "protected-space-insert"
|
||||||
\bind "exclamdown" "self-insert"
|
\bind "exclamdown" "self-insert"
|
||||||
\bind "cent" "self-insert"
|
\bind "cent" "self-insert"
|
||||||
\bind "sterling" "self-insert"
|
\bind "sterling" "self-insert"
|
||||||
|
@ -2410,10 +2410,14 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_QUOTE:
|
case LFUN_QUOTE:
|
||||||
|
#if 0
|
||||||
beforeChange(TEXT(bv_));
|
beforeChange(TEXT(bv_));
|
||||||
TEXT(bv_)->InsertChar(bv_, '\"'); // This " matches the single quote in the code
|
TEXT(bv_)->InsertChar(bv_, '\"'); // This " matches the single quote in the code
|
||||||
update(TEXT(bv_), BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
update(TEXT(bv_), BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||||
moveCursorUpdate(false);
|
moveCursorUpdate(false);
|
||||||
|
#else
|
||||||
|
bv_->insertCorrectQuote();
|
||||||
|
#endif
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_HTMLURL:
|
case LFUN_HTMLURL:
|
||||||
@ -2887,30 +2891,82 @@ bool BufferView::Pimpl::Dispatch(kb_action action, string const & argument)
|
|||||||
|
|
||||||
case LFUN_SELFINSERT:
|
case LFUN_SELFINSERT:
|
||||||
{
|
{
|
||||||
LyXFont const old_font(TEXT(bv_)->real_current_font);
|
#if 0
|
||||||
for (string::size_type i = 0; i < argument.length(); ++i) {
|
LyXText * lt = TEXT(bv_);
|
||||||
TEXT(bv_)->InsertChar(bv_, argument[i]);
|
|
||||||
|
LyXFont const old_font(lt->real_current_font);
|
||||||
|
|
||||||
|
string::const_iterator cit = argument.begin();
|
||||||
|
string::const_iterator end = argument.end();
|
||||||
|
for (; cit != end; ++cit) {
|
||||||
|
lt->InsertChar(bv_, *cit);
|
||||||
// This needs to be in the loop, or else we
|
// This needs to be in the loop, or else we
|
||||||
// won't break lines correctly. (Asger)
|
// won't break lines correctly. (Asger)
|
||||||
update(TEXT(bv_),
|
update(lt,
|
||||||
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
BufferView::SELECT|BufferView::FITCUR|BufferView::CHANGE);
|
||||||
}
|
}
|
||||||
TEXT(bv_)->sel_cursor = TEXT(bv_)->cursor;
|
lt->sel_cursor = lt->cursor;
|
||||||
moveCursorUpdate(false);
|
moveCursorUpdate(false);
|
||||||
|
|
||||||
// real_current_font.number can change so we need to
|
// real_current_font.number can change so we need to
|
||||||
// update the minibuffer
|
// update the minibuffer
|
||||||
if (old_font != TEXT(bv_)->real_current_font)
|
if (old_font != lt->real_current_font)
|
||||||
owner_->showState();
|
owner_->showState();
|
||||||
|
#else
|
||||||
|
if (argument.empty()) break;
|
||||||
|
|
||||||
|
/* Automatically delete the currently selected
|
||||||
|
* text and replace it with what is being
|
||||||
|
* typed in now. Depends on lyxrc settings
|
||||||
|
* "auto_region_delete", which defaults to
|
||||||
|
* true (on). */
|
||||||
|
|
||||||
|
LyXText * lt = TEXT(bv_);
|
||||||
|
|
||||||
|
if (lyxrc.auto_region_delete) {
|
||||||
|
if (lt->selection){
|
||||||
|
lt->CutSelection(bv_, false);
|
||||||
|
bv_->update(lt,
|
||||||
|
BufferView::SELECT
|
||||||
|
| BufferView::FITCUR
|
||||||
|
| BufferView::CHANGE);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
bv_->beforeChange(lt);
|
||||||
|
LyXFont const old_font(lt->real_current_font);
|
||||||
|
|
||||||
|
string::const_iterator cit = argument.begin();
|
||||||
|
string::const_iterator end = argument.end();
|
||||||
|
for (; cit != end; ++cit) {
|
||||||
|
if (greek_kb_flag) {
|
||||||
|
if (!math_insert_greek(bv_, *cit))
|
||||||
|
owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
|
||||||
|
} else
|
||||||
|
owner_->getIntl()->getTrans().TranslateAndInsert(*cit, lt);
|
||||||
|
}
|
||||||
|
|
||||||
|
bv_->update(lt,
|
||||||
|
BufferView::SELECT
|
||||||
|
| BufferView::FITCUR
|
||||||
|
| BufferView::CHANGE);
|
||||||
|
|
||||||
|
lt->sel_cursor = lt->cursor;
|
||||||
|
moveCursorUpdate(false);
|
||||||
|
|
||||||
|
// real_current_font.number can change so we need to
|
||||||
|
// update the minibuffer
|
||||||
|
if (old_font != lt->real_current_font)
|
||||||
|
owner_->showState();
|
||||||
|
//return string();
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case LFUN_DATE_INSERT: // jdblair: date-insert cmd
|
case LFUN_DATE_INSERT: // jdblair: date-insert cmd
|
||||||
{
|
{
|
||||||
struct tm * now_tm;
|
|
||||||
|
|
||||||
time_t now_time_t = time(NULL);
|
time_t now_time_t = time(NULL);
|
||||||
now_tm = localtime(&now_time_t);
|
struct tm * now_tm = localtime(&now_time_t);
|
||||||
setlocale(LC_TIME, "");
|
setlocale(LC_TIME, "");
|
||||||
string arg;
|
string arg;
|
||||||
if (!argument.empty())
|
if (!argument.empty())
|
||||||
|
@ -1,3 +1,15 @@
|
|||||||
|
2001-05-23 Lars Gullik Bjønnes <larsbj@birdstep.com>
|
||||||
|
|
||||||
|
* lyx_main.C (defaultKeyBindings): set KP_enter to point at
|
||||||
|
LFUN_BREAKPARAGRAPH.
|
||||||
|
|
||||||
|
* LyXAction.C (init): remove external name for LFUN_LAYOUTNO, set
|
||||||
|
help test to "internal only", similar for LFUN_INSERT_URL
|
||||||
|
|
||||||
|
* BufferView_pimpl.C (Dispatch::LFUN_QUOTE): change it to to the insertcorrectQuote.
|
||||||
|
(Dispatch::LFUN_SELFINSERT): fix to handle math greek,
|
||||||
|
auto_region_delete and deadkeys.
|
||||||
|
|
||||||
2001-05-22 John Levon <moz@compsoc.man.ac.uk>
|
2001-05-22 John Levon <moz@compsoc.man.ac.uk>
|
||||||
|
|
||||||
* LColor.h:
|
* LColor.h:
|
||||||
|
@ -254,7 +254,7 @@ void LyXAction::init()
|
|||||||
{ LFUN_LAYOUT_COPY, "layout-copy",
|
{ LFUN_LAYOUT_COPY, "layout-copy",
|
||||||
N_("Copy paragraph environment type"), Noop },
|
N_("Copy paragraph environment type"), Noop },
|
||||||
{ LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly },
|
{ LFUN_LAYOUT_DOCUMENT, "layout-document", "", ReadOnly },
|
||||||
{ LFUN_LAYOUTNO, "layout-number", "", Noop }, // internal only
|
{ LFUN_LAYOUTNO, "", "internal only", Noop },
|
||||||
{ LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly },
|
{ LFUN_LAYOUT_PARAGRAPH, "layout-paragraph", "", ReadOnly },
|
||||||
{ LFUN_LAYOUT_PASTE, "layout-paste",
|
{ LFUN_LAYOUT_PASTE, "layout-paste",
|
||||||
N_("Paste paragraph environment type"), Noop },
|
N_("Paste paragraph environment type"), Noop },
|
||||||
@ -377,7 +377,7 @@ void LyXAction::init()
|
|||||||
{ LFUN_UP, "up", "", ReadOnly },
|
{ LFUN_UP, "up", "", ReadOnly },
|
||||||
{ LFUN_UPSEL, "up-select", "", ReadOnly },
|
{ LFUN_UPSEL, "up-select", "", ReadOnly },
|
||||||
{ LFUN_URL, "url-insert", "", Noop },
|
{ LFUN_URL, "url-insert", "", Noop },
|
||||||
{ LFUN_INSERT_URL, "", "", Noop },
|
{ LFUN_INSERT_URL, "", "internal only", Noop },
|
||||||
{ LFUN_VC_CHECKIN, "vc-check-in", "", ReadOnly },
|
{ LFUN_VC_CHECKIN, "vc-check-in", "", ReadOnly },
|
||||||
{ LFUN_VC_CHECKOUT, "vc-check-out", "", ReadOnly },
|
{ LFUN_VC_CHECKOUT, "vc-check-out", "", ReadOnly },
|
||||||
{ LFUN_VC_HISTORY, "vc-history", "", ReadOnly },
|
{ LFUN_VC_HISTORY, "vc-history", "", ReadOnly },
|
||||||
|
@ -473,7 +473,7 @@ void LyX::defaultKeyBindings(kb_keymap * kbmap)
|
|||||||
// e.g. Num Lock set
|
// e.g. Num Lock set
|
||||||
kbmap->bind("KP_0", LFUN_SELFINSERT);
|
kbmap->bind("KP_0", LFUN_SELFINSERT);
|
||||||
kbmap->bind("KP_Decimal", 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_1", LFUN_SELFINSERT);
|
||||||
kbmap->bind("KP_2", LFUN_SELFINSERT);
|
kbmap->bind("KP_2", LFUN_SELFINSERT);
|
||||||
kbmap->bind("KP_3", LFUN_SELFINSERT);
|
kbmap->bind("KP_3", LFUN_SELFINSERT);
|
||||||
|
Loading…
Reference in New Issue
Block a user