]> git.lyx.org Git - lyx.git/blobdiff - src/mathed/math_cursor.C
oh well
[lyx.git] / src / mathed / math_cursor.C
index 89fd224f7f57b1b2d3d3dc09e20756ed49c37d60..914d4e3b484090779facb48cecd2cc6370e9b534 100644 (file)
@@ -144,13 +144,13 @@ struct Selection
                                }
                                // append the left over horizontal cells to the last column
                                idx_type i = p->index(row + p->row(idx), p->ncols() - 1);
-                               for (col_type col = numcols; col < data_.ncols(); ++col) 
+                               for (col_type col = numcols; col < data_.ncols(); ++col)
                                        p->cell(i).push_back(data_.cell(data_.index(row, col)));
                        }
                        // append the left over vertical cells to the last _cell_
                        idx_type i = p->nargs() - 1;
-                       for (row_type row = numrows; row < data_.nrows(); ++row) 
-                               for (col_type col = 0; col < data_.ncols(); ++col) 
+                       for (row_type row = numrows; row < data_.nrows(); ++row)
+                               for (col_type col = 0; col < data_.ncols(); ++col)
                                        p->cell(i).push_back(data_.cell(data_.index(row, col)));
                }
        }
@@ -1253,7 +1253,7 @@ bool MathCursor::goUpDown(bool up)
                                        up ? yo - 4 : formula()->yhigh()
                                );
                }
-               
+
                // any improvement so far?
                int xnew, ynew;
                getPos(xnew, ynew);
@@ -1390,6 +1390,15 @@ bool MathCursor::interpret(string const & s)
 
 bool MathCursor::script(bool up)
 {
+       // Hack to get \\^ and \\_ working
+       if (inMacroMode() && macroName() == "\\") {
+               if (up)
+                       interpret("\\mathcircumflex");
+               else
+                       interpret('_');
+               return true;
+       }
+
        macroModeClose();
        selCut();
        if (hasPrevAtom() && prevAtom()->asScriptInset()) {
@@ -1453,7 +1462,7 @@ bool MathCursor::interpret(char c)
                if (name == "\\") {
                        // remove the '\\'
                        backspace();
-                       if (c == '\\') 
+                       if (c == '\\')
                                interpret("\\backslash");
                        else
                                interpret(string("\\") + c);