commit 3522782c44b5b8c94dcd82125868f5669fc0c9af
Author: Juergen Spitzmueller <[email protected]>
Date: Thu Dec 29 09:17:53 2016 +0100
Fix two hyperlink-insert problems
1. Do not prematurely cut selection (#10306); patch proposed by Daniel
Ramöller
2. Obey lfun argument, even if there is a selection
---
src/Text3.cpp | 6 +-----
1 files changed, 1 insertions(+), 5 deletions(-)
diff --git a/src/Text3.cpp b/src/Text3.cpp
index cc0a96f..3e6fdf0 100644
--- a/src/Text3.cpp
+++ b/src/Text3.cpp
@@ -1775,13 +1775,9 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
}
case LFUN_HREF_INSERT: {
- // FIXME If we're actually given an argument, shouldn't
- // we use it, whether or not we have a selection?
docstring content = cmd.argument();
- if (cur.selection()) {
+ if (content.empty() && cur.selection())
content = cur.selectionAsString(false);
- cutSelection(cur, true, false);
- }
InsetCommandParams p(HYPERLINK_CODE);
if (!content.empty()){