Rainie3535 / sigil

Automatically exported from code.google.com/p/sigil
GNU General Public License v3.0
0 stars 0 forks source link

Find and Replace does not save file when F&R is already open and searching all HTML files #1213

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Based on your post about not seeing the current tab, this shows that's exactly 
what's happening at least in one particular case - Tab data is not saved before 
running Count or Replace All when using search.

1. Start sigil 0.5.0 
2. Switch to Code View
3. Type "hello" in the <P>&nbsp;</P> code
3. Open F&R
4. Set Mode Normal, Look All HTML files
5. Enter "hello" in Find and "test" in Replace
6. Click on Count - 1 found okay
7. Type 3 more hello words in the <P>&nbsp;</P> section in CV (e.g. <P>&nbsp; 
hello hello hello hello</P>) (don't click anywhere but in CV)
8. Click on Count - only 1 found instead of 4
9. Click in TOC or another program, etc.
10. Click on Count - 4 found

And Replace:
10. Click in CV again and add 2 more hello entries
11. Click on Replace All
12. It says 4 were replaced - instead of 6 AND CV is not actually updated with 
the text, even when closing/re-opening the tab

Adding something like SaveTabData to MainWindow, and calling it from Count 
fixes the Count part.  The same for ReplaceAll - and it corrects the displayed 
information.  All functions should ensure data is saved by calling the save 
routine before running (this could just be F&R, but Merge should be checked, 
etc).

It looks like CV is not signalling focusOutEvent when moving to F&R which is 
what I would expect to happen as this would save the data automatically.

Original issue reported on code.google.com by meme90...@gmail.com on 30 Jan 2012 at 4:05

GoogleCodeExporter commented 9 years ago
Revision: ed0e1d4c781a.

We don't want the current tab to signal a focusOutEvent because that will 
trigger the well-formed check. I've added a save tab content call for the 
current tab in each of the all file functions in F&R.

Original comment by john@nachtimwald.com on 1 Feb 2012 at 1:10

GoogleCodeExporter commented 9 years ago

Original comment by meme90...@gmail.com on 28 Mar 2012 at 3:58

GoogleCodeExporter commented 9 years ago

Original comment by daveheil...@gmail.com on 19 May 2012 at 3:20