]> git.lyx.org Git - features.git/commitdiff
apply change of languange to the word under cursor if there is no selection
authorStephan Witt <switt@lyx.org>
Wed, 2 Feb 2011 10:55:17 +0000 (10:55 +0000)
committerStephan Witt <switt@lyx.org>
Wed, 2 Feb 2011 10:55:17 +0000 (10:55 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@37415 a592a061-630c-0410-9148-cb99ea01b6c8

src/Text3.cpp

index dad691b6d103ca00bdb2a92752146d86ae8c4554..713a016d2323a38dae637a94cdd9f073fc05d22e 100644 (file)
@@ -1889,6 +1889,10 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                Language const * lang = languages.getLanguage(to_utf8(cmd.argument()));
                if (!lang)
                        break;
+               if (!cur.selection()) {
+                       // apply to current word
+                       selectWordWhenUnderCursor(cur, WHOLE_WORD);
+               }
                Font font(ignore_font, lang);
                toggleAndShow(cur, this, font);
                break;