mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-11-09 18:31:04 +00:00
Fix thinko: default paste method for plain text
* src/lyxtext.h * src/text3.C (pasteString): Change argument to bool * src/text3.C (LyXText::dispatch): (LFUN_PASTE): Paste plain text as paragraphs, not as lines (LyXText::dispatch): Adjust to pasteString change * lib/bind/cua.bind: * lib/bind/sciword.bind: * lib/bind/mac.bind: Move shortcuts from "clipboard-paste paragraph" and "primary-selection-paste paragraph" to "primary-selection-paste" and "clipboard-paste", since the "paragaph" versions are used in LFUN_PASTE and middle-mouse-button paste. Now "primary-selection-paste" has the same shortcut it always had, and "clipboard-paste" has the shortcut that was originally assigned to "primary-selection-paste paragraph". git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@16553 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
53e186297e
commit
1103be3d85
@ -68,8 +68,8 @@
|
||||
\bind "C-c" "copy"
|
||||
\bind "C-x" "cut"
|
||||
\bind "C-v" "paste"
|
||||
\bind "C-M-v" "clipboard-paste paragraph"
|
||||
\bind "C-S-v" "primary-selection-paste paragraph"
|
||||
\bind "C-S-v" "clipboard-paste"
|
||||
\bind "C-M-v" "primary-selection-paste"
|
||||
|
||||
\bind "C-z" "undo"
|
||||
\bind "C-y" "redo"
|
||||
|
@ -58,8 +58,8 @@
|
||||
\bind "C-c" "copy"
|
||||
\bind "C-x" "cut"
|
||||
\bind "C-v" "paste"
|
||||
\bind "C-M-v" "clipboard-paste paragraph"
|
||||
\bind "C-S-v" "primary-selection-paste paragraph"
|
||||
\bind "C-S-v" "clipboard-paste"
|
||||
\bind "C-M-v" "primary-selection-paste"
|
||||
|
||||
\bind "C-z" "undo"
|
||||
\bind "C-S-Z" "redo"
|
||||
|
@ -105,8 +105,8 @@
|
||||
|
||||
\bind "C-u" "font-underline"
|
||||
\bind "C-v" "paste"
|
||||
\bind "C-M-v" "clipboard-paste paragraph"
|
||||
\bind "C-S-v" "primary-selection-paste paragraph"
|
||||
\bind "C-S-v" "clipboard-paste"
|
||||
\bind "C-M-v" "primary-selection-paste"
|
||||
\bind "C-w" "buffer-close"
|
||||
\bind "C-x" "cut"
|
||||
\bind "C-z" "undo"
|
||||
|
@ -387,11 +387,11 @@ private:
|
||||
/// set 'number' font property
|
||||
void number(LCursor & cur);
|
||||
|
||||
/// paste string at current cursor.
|
||||
/// paste plain text at current cursor.
|
||||
/// \param str string to paste
|
||||
/// \param argument method for parsing ("paragraph" is special)
|
||||
/// \param asParagraphs whether to paste as paragraphs or as lines
|
||||
void pasteString(LCursor & cur, docstring const & str,
|
||||
docstring const & argument);
|
||||
bool asParagraphs);
|
||||
};
|
||||
|
||||
} // namespace lyx
|
||||
|
12
src/text3.C
12
src/text3.C
@ -759,7 +759,7 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
cur.message(_("Paste"));
|
||||
cap::replaceSelection(cur);
|
||||
if (cmd.argument().empty() && !theClipboard().isInternal())
|
||||
pasteString(cur, theClipboard().get(), docstring());
|
||||
pasteString(cur, theClipboard().get(), true);
|
||||
else {
|
||||
string const arg(to_utf8(cmd.argument()));
|
||||
pasteSelection(cur, bv->buffer()->errorList("Paste"),
|
||||
@ -866,11 +866,13 @@ void LyXText::dispatch(LCursor & cur, FuncRequest & cmd)
|
||||
}
|
||||
|
||||
case LFUN_CLIPBOARD_PASTE:
|
||||
pasteString(cur, theClipboard().get(), cmd.argument());
|
||||
pasteString(cur, theClipboard().get(),
|
||||
cmd.argument() == "paragraph");
|
||||
break;
|
||||
|
||||
case LFUN_PRIMARY_SELECTION_PASTE:
|
||||
pasteString(cur, theSelection().get(), cmd.argument());
|
||||
pasteString(cur, theSelection().get(),
|
||||
cmd.argument() == "paragraph");
|
||||
break;
|
||||
|
||||
case LFUN_UNICODE_INSERT: {
|
||||
@ -1890,12 +1892,12 @@ bool LyXText::getStatus(LCursor & cur, FuncRequest const & cmd,
|
||||
|
||||
|
||||
void LyXText::pasteString(LCursor & cur, docstring const & clip,
|
||||
docstring const & argument)
|
||||
bool asParagraphs)
|
||||
{
|
||||
cur.clearSelection();
|
||||
if (!clip.empty()) {
|
||||
recordUndo(cur);
|
||||
if (argument == "paragraph")
|
||||
if (asParagraphs)
|
||||
insertStringAsParagraphs(cur, clip);
|
||||
else
|
||||
insertStringAsLines(cur, clip);
|
||||
|
Loading…
Reference in New Issue
Block a user