]> git.lyx.org Git - lyx.git/commitdiff
- updated BUGS
authorAndré Pönitz <poenitz@gmx.net>
Tue, 23 Oct 2001 07:33:03 +0000 (07:33 +0000)
committerAndré Pönitz <poenitz@gmx.net>
Tue, 23 Oct 2001 07:33:03 +0000 (07:33 +0000)
- improved cursor movement in grids when pressing home/end

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@2911 a592a061-630c-0410-9148-cb99ea01b6c8

src/mathed/BUGS
src/mathed/ChangeLog
src/mathed/math_gridinset.C
src/mathed/math_gridinset.h
src/mathed/math_nestinset.C

index 4005050395c0b25d19c9e31c368f802192c193f1..b373073a64c8f3ffa1f25f70dd648c3bdd4bffeb 100644 (file)
@@ -36,7 +36,7 @@ Dekel:
 
 Macros:
 
- - When changing the macro definition, all instances are not updated.
+// - When changing the macro definition, all instances are not updated.
 
 // - If I have macros \newcommand{\foo}[1]{[#1]} and
 //   \newcommand{\foox}{\foo{x}} then when an instance of \foox is drawn on
@@ -47,8 +47,8 @@ Macros:
 
 Misc:
 
-- If I have x_{1}^{2}, I put the cursor before the 2, and press backspace,
-  the result is 'x2'. The correct result should be 'x_{1}2'
+// - If I have x_{1}^{2}, I put the cursor before the 2, and press backspace,
+//  the result is 'x2'. The correct result should be 'x_{1}2'
 
 // - If I mark some text and then press ^, then the marked text is deleted.
 //   The correct behavior is to put the marked text in the superscript.
@@ -87,8 +87,8 @@ Misc:
 
 Eran Tromer:
 
-- When exiting the formula during selection, the anchor moves to the
-  left of the formula and there's no way to go back.
+// - When exiting the formula during selection, the anchor moves to the
+//   left of the formula and there's no way to go back.
 
 // - Scripts are too large. $\log_2$ exceeds inset frame (non-displayed).
 
@@ -107,11 +107,11 @@ Eran Tromer:
 // - When choosing to insert "\left\Vert \right\Vert" parenthesis using
 //   the maths [sic] panel, a "\left( \right." is inserted instead.
 
- - Formula inside tabular cell: red frame of cell inset and purple 
-   frame of formula can overlap, causing leftovers when leaving 
-   formula. To get an example, insert a 1x1 tabular into a new document,
-   enter the cell its cell and press 
-   M-m ( M-f 1 <right> <right> <right>       (zoom=100, screenDPI=100)
+// - Formula inside tabular cell: red frame of cell inset and purple 
+//   frame of formula can overlap, causing leftovers when leaving 
+//   formula. To get an example, insert a 1x1 tabular into a new document,
+//   enter the cell its cell and press 
+//   M-m ( M-f 1 <right> <right> <right>       (zoom=100, screenDPI=100)
 
 - When selecting multiple cells in a array using the keyboard, <left>
   etc. should can move whole cell at a time -- no need to navigate 
@@ -167,11 +167,12 @@ From: 
 // a lot when typing because, as the previous one, requires going back
 // and correcting.
  
-- the movement is sometimes clumsy inside this arrayed equations: ie. C-a (or 
- "home" are understood as "beginning of the formula" instead of "beginning of 
- the equation". Again, a lot of movement has to be made. I suggest mapping 
- "beginning of doc" with "beginning of formula" and so on (very intuitive), in 
- case you don't deem appropriate the "namespace idea" below.
+// - the movement is sometimes clumsy inside this arrayed equations: ie.
+// C-a (or "home" are understood as "beginning of the formula" instead of
+// "beginning of the equation". Again, a lot of movement has to be made.
+// I suggest mapping "beginning of doc" with "beginning of formula" and so
+// on (very intuitive), in case you don't deem appropriate the "namespace
+// idea" below.
  
 //- movement between macro boxes is also weird, but in this one it's perhaps 
 // just me.  
@@ -246,11 +247,13 @@ remember. You learn it.  c) Actions which are used rarely should be
 mnemonic -- easy to remember -- even if they are multiple keypresses.
 Things you do rarely you care less about the time it takes to perform. 
 
-2) Math-mode entry  Under the xemacs keybindings, which I use, (damn it,
-I don't want to confuse my poor muscle memory more than necessary by
-learning too many different bindings for the same actions), the key
-sequence to enter math-mode is 'M-c m'. I'm not sure exactly what to
-propose instead, but I really think this needs to be only one keypress. 
+// 2) Math-mode entry  Under the xemacs keybindings, which I use, (damn it,
+// I don't want to confuse my poor muscle memory more than necessary by
+// learning too many different bindings for the same actions), the key
+// sequence to enter math-mode is 'M-c m'. I'm not sure exactly what to
+// propose instead, but I really think this needs to be only one keypress. 
+
+:: Not a mathed bug
 
 As an aside, you may think that I'm whining over nothing. However, when
 you enter math mode as often as I do (often more than once a sentence) it
@@ -354,292 +357,3 @@ Tuukka:
 :: Not a bug. It's allowed by LaTeX and there might be other reasons for
 :: putting labels there. I won't add extra code to disable this.
 
-
-Jean-Marc:
-
-
-// cxx: Info: ../../../lyx-devel/src/mathed/array.C, line 98: conversion to
-//           integral type of smaller size could lose data (D:intconlosbit)
-//     return bf_.size();
-// ---------------^
-
-// cxx: Info: ../../../lyx-devel/src/mathed/formula.h, line 56: 
-//           "void InsetFormula::write(std::ostream &) const" does not match
-//           "Inset::write" -- virtual function override intended? (D:nonfundec)
-//     void write(std::ostream &) const;
-// -------------^
-:: not a bug
-
-// cxx: Info: ../../../lyx-devel/src/mathed/formula.h, line 58: 
-//           "void InsetFormula::read(LyXLex &)" does not match "Inset::read" --
-//           virtual function override intended? (D:nonfundec)
-//     void read(LyXLex & lex);
-// -------------^
-:: not a bug
-:: etc.
-
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 94: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int ncols() const { return colinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 96: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int nrows() const { return rowinfo_.size(); }
------------------------------------^
-
-// cxx: Info: ../../../lyx-devel/src/mathed/formulabase.C, line 63: function
-//           "<unnamed>::mathed_init_fonts" was declared but never referenced
-//           (D:declbutnotref)
-// void mathed_init_fonts();
-// -----^
-
-//cxx: Info: ../../../lyx-devel/src/mathed/formulabase.C, line 65: function
-//          "<unnamed>::nicelabel" was declared but never referenced
-//          (D:declbutnotref)
-//string nicelabel(string const & label)
-//-------^
-
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 94: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int ncols() const { return colinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 96: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int nrows() const { return rowinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 176: 
-          label "__Unreachable1" was declared but never referenced
-          (D:declbutnotref)
-       lyxerr << "MC: " << what << "\n";
---------^
-cxx: Warning: ../../../lyx-devel/src/mathed/math_cursor.C, line 193: statement
-          is unreachable (D:codeunreachable)
-       lyxerr << "\n\n\n=================vvvvvvvvvvvvv=======================   "
---------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 193: 
-          label "__Unreachable2" was declared but never referenced
-          (D:declbutnotref)
-       lyxerr << "\n\n\n=================vvvvvvvvvvvvv=======================   "
---------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 351: 
-          controlling expression is constant (D:boolexprconst)
-       while (1) {
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 597: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-               pos() = pos() - s.size();
-----------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 828: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-       for (int i = Cursor_.size() - 1; i >= 0; --i) {
----------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 1049: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       return p ? p->valign() : 0;
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 1057: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       return p ? p->halign(idx % p->ncols()) : 0;
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_cursor.C, line 109: function
-          "<unnamed>::operator<<" was declared but never referenced
-          (D:declbutnotref)
-std::ostream & operator<<(std::ostream & os, MathCursorPos const & p)
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_fracinset.h, line 30: type
-          qualifier on return type is meaningless (D:nousetypqualret)
-       char const name() const;
--------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathNestInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_factory.C, line 29: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-               return new MathSpecialCharInset(l->id);
-------------------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_fracinset.h, line 30: type
-          qualifier on return type is meaningless (D:nousetypqualret)
-       char const name() const;
--------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 94: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int ncols() const { return colinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 96: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int nrows() const { return rowinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.C, line 71: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int n = hh.size();
-----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/../lyxlex.h, line 32: access
-          control not specified ("private" by default) (D:misaccspe)
-class LyXLex : boost::noncopyable { 
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_hash.C, line 177: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-                       tmp.token = tokenEnum(lex.getString());
-----------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_hash.C, line 179: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-                       tmp.latex_font_id = lex.getInteger();
-------------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathNestInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/../layout.h, line 554: access
-          control not specified ("private" by default) (D:misaccspe)
-class LyXTextClassList : boost::noncopyable {
--------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.C, line 122: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-                       str[1] += i;
-------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.C, line 101: 
-          variable "col" was set but never used (D:setbutnotused)
-       LColor::color col;
-----------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathNestInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macroarg.C, line 21: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       str_[1] = '0' + n;
-----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathNestInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 94: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int ncols() const { return colinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 96: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int nrows() const { return rowinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/../layout.h, line 554: access
-          control not specified ("private" by default) (D:misaccspe)
-class LyXTextClassList : boost::noncopyable {
--------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_matrixinset.C, line 40: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-                       return it - array.begin();
--------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_nestinset.C, line 16: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       return cells_.size();
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 94: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int ncols() const { return colinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 96: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int nrows() const { return rowinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_macro.h, line 54: 
-          "void MathMacro::dump(std::ostream &) const" does not match
-          "MathNestInset::dump" -- virtual function override intended?
-          (D:nonfundec)
-       void dump(std::ostream & os) const;
--------------^
-cxx: Info: ../../../lyx-devel/src/mathed/../lyxlex.h, line 32: access
-          control not specified ("private" by default) (D:misaccspe)
-class LyXLex : boost::noncopyable { 
----------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_parser.C, line 60: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-       unsigned n = s.size();
----------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_parser.C, line 437: 
-          controlling expression is constant (D:boolexprconst)
-       for (int row = 0; true; ++row) {
---------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_parser.C, line 786: conversion
-          to integral type of smaller size could lose data (D:intconlosbit)
-                               MathArrayInset * m = new MathArrayInset(halign.size(), 1);
-------------------------------------------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_parser.C, line 804: 
-          controlling expression is constant (D:boolexprconst)
-                       while (1) {
--------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 94: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int ncols() const { return colinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_gridinset.h, line 96: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-       int nrows() const { return rowinfo_.size(); }
------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_symbolinset.C, line 75: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-               mathed_char_dim(code2(), size_, sym_->id,
-------------------------------------------------^
-cxx: Info: ../../../lyx-devel/src/mathed/math_symbolinset.C, line 92: 
-          conversion to integral type of smaller size could lose data
-          (D:intconlosbit)
-               drawChar(pain, code2(), size_, x, y, sym_->id);
------------------------------------------------------^
index 342be7a290808ca2734f4115b879fb95a8938182..c487c47ca5bc32d102e3d6eb1cc2faf31bc346da 100644 (file)
@@ -10,6 +10,8 @@
        * math_inset.[Ch]:
          formula.C: remove unused static member int MathInset::workwidth
 
+       * math_gridinset.[Ch]: implement idxHome() and idxEnd()
+
 2001-10-17  André Pönitz  <poenitz@gmx.net>
 
        * math_inset.h:
index d583e90ab2ad99ca894924adb35b64141d9adbf8..46b77d26511a3e7eba4cc1b19f042cb381f155f1 100644 (file)
@@ -473,6 +473,46 @@ bool MathGridInset::idxLast(idx_type & idx, pos_type & pos) const
 }
 
 
+bool MathGridInset::idxHome(idx_type & idx, pos_type & pos) const
+{
+       if (pos > 0) {
+               pos = 0;
+               return true;
+       }
+       if (col(idx) > 0) {
+               idx -= idx % ncols();
+               pos = 0;
+               return true;
+       }
+       if (idx > 0) {
+               idx = 0;
+               pos = 0;
+               return true;
+       }
+       return false;
+}
+
+
+bool MathGridInset::idxEnd(idx_type & idx, pos_type & pos) const
+{
+       if (pos < cell(idx).size()) {
+               pos = cell(idx).size();
+               return true;
+       }
+       if (col(idx) < ncols() - 1) {
+               idx = idx - idx % ncols() + ncols() - 1;
+               pos = cell(idx).size();
+               return true;
+       }
+       if (idx < nargs() - 1) {
+               idx = nargs() - 1;
+               pos = cell(idx).size();
+               return true;
+       }
+       return false;
+}
+
+
 void MathGridInset::idxDelete(idx_type & idx, bool & popit, bool & deleteit)
 {
        popit    = false;
index c0b64f03e7c8154031470f468b2d375c098b078d..8226b5101f2d8a3434f90d867d0b31f45015164b 100644 (file)
@@ -120,6 +120,10 @@ public:
        ///
        bool idxLast(idx_type &, pos_type &) const;
        ///
+       bool idxHome(idx_type &, pos_type &) const;
+       ///
+       bool idxEnd(idx_type &, pos_type &) const;
+       ///
        void idxDelete(idx_type &, bool &, bool &);
        ///
        void idxDeleteRange(idx_type, idx_type);
index 6e051d1744f6c1aa676fe32292976d0247a4b503..ac8150043a3560d137f76ad34a82dde0a0aafde6 100644 (file)
@@ -130,7 +130,6 @@ bool MathNestInset::idxEnd(idx_type & idx, pos_type & pos) const
        pos_type n = cell(idx).size();
        if (pos == n)
                return false;
-
        pos = n;
        return true;
 }