[LyX/master] Restore Chapter 11

2024-03-30 Thread jpc
commit 55330a784455e0baa6fca36f0bfd736f03b58601
Author: jpc 
Date:   Sat Mar 30 17:38:18 2024 +0100

   Restore Chapter 11
---
 lib/doc/Additional.lyx | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/doc/Additional.lyx b/lib/doc/Additional.lyx
index 46abf3d7d3..1c4fb906d4 100644
--- a/lib/doc/Additional.lyx
+++ b/lib/doc/Additional.lyx
@@ -25944,7 +25944,11 @@ Forward search works both with DVI and PDF output.
 \end_inset
 
 e.,
- which format is already there in the temporary directory) and chooses the 
appropriate configuration for the respective format.\SpecialChar LyX
+ which format is already there in the temporary directory) and chooses the 
appropriate configuration for the respective format.
+\end_layout
+
+\begin_layout Chapter
+\SpecialChar LyX
  Features needing Extra Software
 \end_layout
 
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs


[LyX/master] Fix crash with quick search starting with mathed selection

2024-03-30 Thread Juergen Spitzmueller
commit babb5b007bdb273c12255edf7c84a537327c0400
Author: Juergen Spitzmueller 
Date:   Sat Mar 30 10:14:34 2024 +0100

Fix crash with quick search starting with mathed selection

setCursorSelection does not work with math. Copy the method from
spellchecker.
---
 src/lyxfind.cpp | 25 +++--
 1 file changed, 23 insertions(+), 2 deletions(-)

diff --git a/src/lyxfind.cpp b/src/lyxfind.cpp
index edf21d4022..6281b82abc 100644
--- a/src/lyxfind.cpp
+++ b/src/lyxfind.cpp
@@ -281,6 +281,27 @@ bool searchAllowed(docstring const & str)
return true;
 }
 
+void setSelection(BufferView * bv, DocIterator const & from, DocIterator const 
& to)
+{
+   DocIterator end = to;
+
+   if (from.pit() != end.pit()) {
+   // there are multiple paragraphs in selection
+   Cursor & bvcur = bv->cursor();
+   bvcur.setCursor(from);
+   bvcur.clearSelection();
+   bvcur.selection(true);
+   bvcur.setCursor(end);
+   bvcur.selection(true);
+   } else {
+   // FIXME LFUN
+   // If we used a LFUN, dispatch would do all of this for us
+   int const size = end.pos() - from.pos();
+   bv->putSelectionAt(from, size, false);
+   }
+   bv->processUpdateFlags(Update::Force | Update::FitCursor);
+}
+
 } // namespace
 
 
@@ -387,7 +408,7 @@ bool findOne(BufferView * bv, docstring const & searchstr,
// restore original selection
if (had_selection) {
bv->cursor().resetAnchor();
-   bv->setCursorSelectionTo(endcur);
+   setSelection(bv, startcur, endcur);
}
return false;
}
@@ -464,7 +485,7 @@ int replaceAll(BufferView * bv,
if (had_selection) {
endcur.fixIfBroken();
bv->cursor().resetAnchor();
-   bv->setCursorSelectionTo(endcur);
+   setSelection(bv, startcur, endcur);
}
 
return num;
-- 
lyx-cvs mailing list
lyx-cvs@lists.lyx.org
http://lists.lyx.org/mailman/listinfo/lyx-cvs