]> git.lyx.org Git - features.git/commitdiff
Removed shortcuts to toggle autocorrect.
authorIsaac <IsaacOscar@live.com.au>
Fri, 24 May 2019 23:07:26 +0000 (11:07 +1200)
committerJean-Marc Lasgouttes <lasgouttes@lyx.org>
Mon, 3 Jun 2019 09:09:09 +0000 (11:09 +0200)
They are not really needed now that autocorrection can be undone. This
increases autocorrect usability.

src/Cursor.cpp
src/Cursor.h
src/mathed/InsetMathNest.cpp

index 7623c5b0c71eb9b8e82b1396870c02901822c093..48a74f3bddbb3ed57bf70836a8886d36bf11efcb 100644 (file)
@@ -121,19 +121,19 @@ DocIterator bruteFind(Cursor const & c, int x, int y)
 
 CursorData::CursorData()
        : DocIterator(), anchor_(), selection_(false), mark_(false),
-         word_selection_(false), autocorrect_(false), current_font(inherit_font)
+         word_selection_(false), current_font(inherit_font)
 {}
 
 
 CursorData::CursorData(Buffer * buffer)
        : DocIterator(buffer), anchor_(), selection_(false), mark_(false),
-         word_selection_(false), autocorrect_(false), current_font(inherit_font)
+         word_selection_(false), current_font(inherit_font)
 {}
 
 
 CursorData::CursorData(DocIterator const & dit)
        : DocIterator(dit), anchor_(), selection_(false), mark_(false),
-         word_selection_(false), autocorrect_(false), current_font(inherit_font)
+         word_selection_(false), current_font(inherit_font)
 {}
 
 
index 3d3db5daa2b78bd2c481ddcbc6536caf6c58453d..35d2fc97680dcfc9989c50a29f18f3ed13a9c2c5 100644 (file)
@@ -160,11 +160,6 @@ public:
        ///
        docstring currentState(bool devel_mode) const;
 
-       /// auto-correct mode
-       bool autocorrect() const { return autocorrect_; }
-       /// auto-correct mode
-       bool & autocorrect() { return autocorrect_; }
-
        /// fix cursor in circumstances that should never happen.
        /// \retval true if a fix occurred.
        bool fixIfBroken();
@@ -238,8 +233,6 @@ private:
        //
        // math specific stuff that could be promoted to "global" later
        //
-       /// do we allow autocorrection
-       bool autocorrect_;
 
        // FIXME: make them private
 public:
index 85e4dd7c70043d18d28b80b55618fb184efe5686..3078ef92deccf52c909830447a1d381116976a4b 100644 (file)
@@ -706,12 +706,6 @@ void InsetMathNest::doDispatch(Cursor & cur, FuncRequest & cmd)
                        || act == LFUN_PARAGRAPH_UP_SELECT;
                cur.selHandle(select);
 
-               // handle autocorrect:
-               if (lyxrc.autocorrection_math && cur.autocorrect()) {
-                       cur.autocorrect() = false;
-                       cur.message(_("Autocorrect Off ('!' to enter)"));
-               }
-
                // go up/down
                bool up = act == LFUN_UP || act == LFUN_UP_SELECT
                        || act == LFUN_PARAGRAPH_UP || act == LFUN_PARAGRAPH_UP_SELECT;
@@ -1729,18 +1723,6 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
        }
 
 
-       // leave autocorrect mode if necessary
-       if (lyxrc.autocorrection_math && c == ' ' && cur.autocorrect()) {
-               cur.autocorrect() = false;
-               cur.message(_("Autocorrect Off ('!' to enter)"));
-               return true;
-       }
-       if (lyxrc.autocorrection_math && c == '!' && !cur.autocorrect()) {
-               cur.autocorrect() = true;
-               cur.message(_("Autocorrect On (<space> to exit)"));
-               return true;
-       }
-
        // just clear selection on pressing the space bar
        if (cur.selection() && c == ' ') {
                cur.selection(false);
@@ -1867,18 +1849,12 @@ bool InsetMathNest::interpretChar(Cursor & cur, char_type const c)
 
 
        // try auto-correction
-       if (lyxrc.autocorrection_math && cur.autocorrect() && cur.pos() != 0
+       if (lyxrc.autocorrection_math && cur.pos() != 0
                  && math_autocorrect(cur, c))
                return true;
 
        // no special circumstances, so insert the character without any fuss
        cur.insert(c);
-       if (lyxrc.autocorrection_math) {
-               if (!cur.autocorrect())
-                       cur.message(_("Autocorrect Off ('!' to enter)"));
-               else
-                       cur.message(_("Autocorrect On (<space> to exit)"));
-       }
        return true;
 }