]> git.lyx.org Git - features.git/blobdiff - src/Text.cpp
Add proper extension as needed in Save as and Export
[features.git] / src / Text.cpp
index aa70b18cbfb8bbba8fe7ecf0e0c97214dc80207c..7857e5e06c9dc00cd6a107102031bd60041b8676 100644 (file)
@@ -1369,6 +1369,20 @@ void Text::selectWord(Cursor & cur, word_location loc)
 }
 
 
+void Text::expandWordSel(Cursor & cur)
+{
+       // get selection of word around cur
+       Cursor c = cur;
+       c.selection(false);
+       c.text()->selectWord(c, WHOLE_WORD);
+       // use the correct word boundary, depending on selection direction
+       if (cur.top() > cur.normalAnchor())
+               cur.pos() = c.selEnd().pos();
+       else
+               cur.pos() = c.selBegin().pos();
+}
+
+
 void Text::selectAll(Cursor & cur)
 {
        LBUFERR(this == cur.text());
@@ -2149,7 +2163,10 @@ docstring Text::currentState(CursorData const & cur, bool devel_mode) const
                if (!par.empty() && cur.pos() < par.size()) {
                        // Force output of code point, not character
                        size_t const c = par.getChar(cur.pos());
-                       os << _(", Char: 0x") << hex << c;
+                       if (c == META_INSET)
+                               os << ", Char: INSET";
+                       else
+                               os << _(", Char: 0x") << hex << c;
                }
                os << _(", Boundary: ") << cur.boundary();
 //             Row & row = cur.textRow();