]> git.lyx.org Git - lyx.git/blobdiff - src/Text3.cpp
Account for old versions of Pygments
[lyx.git] / src / Text3.cpp
index 617037f87168498c265897453cb9dbf117e14ad0..71293f80301152055633644007ce08bab5740db3 100644 (file)
@@ -1243,6 +1243,8 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                string const name = to_utf8(cmd.argument());
                if (name == "hyphenation")
                        specialChar(cur, InsetSpecialChar::HYPHENATION);
+               else if (name == "allowbreak")
+                       specialChar(cur, InsetSpecialChar::ALLOWBREAK);
                else if (name == "ligature-break")
                        specialChar(cur, InsetSpecialChar::LIGATURE_BREAK);
                else if (name == "slash")
@@ -1690,7 +1692,7 @@ void Text::dispatch(Cursor & cur, FuncRequest & cmd)
                int const wh = bv->workHeight();
                int const y = max(0, min(wh - 1, cmd.y()));
 
-               tm->setCursorFromCoordinates(cur, cmd.x(), y, true);
+               tm->setCursorFromCoordinates(cur, cmd.x(), y);
                cur.setTargetX(cmd.x());
                // Don't allow selecting a separator inset
                if (cur.pos() && cur.paragraph().isEnvSeparator(cur.pos() - 1))
@@ -2839,19 +2841,13 @@ bool Text::getStatus(Cursor & cur, FuncRequest const & cmd,
                        for (; pit <= lastpit; ++pit) {
                                if (pars_[pit].layout() != lay)
                                        break;
-                               InsetList::const_iterator it = pars_[pit].insetList().begin();
-                               InsetList::const_iterator end = pars_[pit].insetList().end();
-                               for (; it != end; ++it) {
-                                       if (it->inset->lyxCode() == ARG_CODE) {
-                                               InsetArgument const * ins =
-                                                       static_cast<InsetArgument const *>(it->inset);
+                               for (auto const & table : pars_[pit].insetList())
+                                       if (InsetArgument const * ins = table.inset->asInsetArgument())
                                                if (ins->name() == arg) {
                                                        // we have this already
                                                        enable = false;
                                                        break;
                                                }
-                                       }
-                               }
                        }
                } else
                        enable = false;