]> git.lyx.org Git - lyx.git/commitdiff
Do not allow completion when there is an active selection
authorJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 3 Jul 2018 14:53:15 +0000 (16:53 +0200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Tue, 3 Jul 2018 15:01:20 +0000 (17:01 +0200)
We do it in texted only, mathed is more difficult and not so relevant IMO.

src/Text.cpp

index b38baa79539ba1942e928c7fc41c43a0419f4514..cf5b2ef02ef7bf0efaa7dfd5ea7e042fc264a715 100644 (file)
@@ -2194,7 +2194,8 @@ docstring Text::previousWord(CursorSlice const & sl) const
 bool Text::completionSupported(Cursor const & cur) const
 {
        Paragraph const & par = cur.paragraph();
-       return cur.pos() > 0
+       return !cur.selection()
+               && cur.pos() > 0
                && (cur.pos() >= par.size() || par.isWordSeparator(cur.pos()))
                && !par.isWordSeparator(cur.pos() - 1);
 }