![]() |
#1 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
|
Issue with Clips & Search dialog
The anomalous behaviour shown below
-- has been showing at least on all Sigil 2.x -- tested for Sigil 2.62 on * Windos 10 and 11 * Ubuntu Mate Behaviour when trying to insert saved clip into the Search&Replace dialog: -- from the Clips window, the focus jumps to the main window: --from Clips toolbar, the clip is inserted as a string--capture group not applied Compare with the expected behaviour in code view window With many thanks to all the Sigil developers! |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Please show the exact clip used in each case by using the clips editor to show the raw text you are trying to insert.
CV uses search and replace to actually insert the clip in itself. I do not think that same approach is used when the paste target is not CodeView. That in and of itself may explain the difference in replacement \1 The first result is definitely a bug if focus was actually in the Replace and not in CV itself. Please note that more than one paste target can have highlighted text at the same time but only 1 should have had focus and been set as the paste target. I will look into that behaviour. |
![]() |
![]() |
![]() |
#3 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
|
Quote:
Code:
Name: ‘’ Text: ‘\1’ 2. From clips toolbar to Search o Replace --> replaces selection with ‘\1’, thus only works for clips like Code:
Name: center Text: class="center" |
|
![]() |
![]() |
![]() |
#5 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
|
Quote:
Thus: the clips window is unusable with S&R, and the clip toolbar works in plain insert mode, *not* for surround. And, contrary to the reference by Becky e-Book, my tests show no difference with tume of usage... |
|
![]() |
![]() |
![]() |
#6 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
|
As for 1, that is a bug I can recreate in MacOS. I will investigate.
As for 2, that is how Sigil has always worked as far back as I have tested. The exact string is pasted into Replace where 99% of the time you want the \1 to be inserted. What version of Sigil did not paste the \1 as is into a replace field? Once I know what version to test with I can try to track down what if any changes might have happened since then. |
![]() |
![]() |
![]() |
#7 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Okay, I have a potential fix for your issue 1. It is specific to the Clips Window as a source so should fix the issue. After some additional testing, I will push it to master.
As for your issue 2, PasteTarget has worked like that since the Sigil 0.8.x series according to the code, so I do not think this is a bug as pasting \1 into Replace strings should be quite common. |
![]() |
![]() |
![]() |
#8 | |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
|
Quote:
My issue 2. comes from: -- being newbie to the clip toolbar--added it as an attempted workaround for issue 1. -- usually switching S&R between Regexp and Case Sensitive modes, after some mix-ups with unescaped characters... So, I simply must learn to take the feature into account. My gratitude for solution and information. |
|
![]() |
![]() |
![]() |
#9 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Quote:
The problem was that the Clips Window(QDockWidget) emits a PasteClip signal that invoked a routine in MainWindow that always just pasted into the current CV ignoring the m_LastPasteTarget. I changed it in my box to be much much smarter about when to update m_LastPasteTarget when focus changes like when you click on a Widget that accepts focus like the ClipsWindow. That would cause the m_LastPasteTarget to get reset to 0 when in fact that should only happen when focus moves to a new Tab that is not editable (i.e. ImageTab, FontTab, AVTab, or PdfTab) which means the previous focus window is no longer viable. All other PasteTargets remain viable while the MainWindow itself is viable. I need to test this change harder before committing it. Last edited by KevinH; Yesterday at 03:47 PM. |
|
![]() |
![]() |
![]() |
#10 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Okay, I have tested a solution to the ClipsWindow not properly pasting into the Find or Replace fields. I have pushed this fix to master. It should appear in the next release of Sigil.
Please note: this fix was a bit extensive and if stale m_LastPasteTargets are used could cause a crash. I have tried to track down all ways to detect and prevent stale m_LastPasteTarget values. If you build you own from master, I would appreciate hearing any issues you run into when pasting clips from the clips menu, the clips Window, the Clips Editor or the clips on the clips toolbars into any PasteTarget. |
![]() |
![]() |
![]() |
#11 |
Addict
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
|
Sorry, Kevin: hassle enough getting my dual boot in shape to try compiling, which never was one of my accomplishments... I shall stick to de appimage for the time being--and wait for the next release.
By the way: I have also noticed that in the early stages of an extensive editing job, the Search tool becomes quite unreliable when 'wrap' is unchecked--i.e.: no clear way to tell which is 'down' from a given page. Outdated NCX? File renaming and TOC regeneration seem to fix it, and meanwhile, beginning Search from a CSS file. IMHO it should documented as a warning... |
![]() |
![]() |
![]() |
#12 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
|
Not seeing any of those issues on my machine. Nothing has changed in search in the last couple of releases. Please note that the Wrap checkbox only has any meaning when searching in the "Current File" mode. When searching across multiple files the state of the search is kept so that you visit all matches just once. You can override that by changing any of the search parameters (which starts a new search) or manually hitting the restart search button.
Changing the ncx or regenerating it has no impact on search or search order. |
![]() |
![]() |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Destination "uuid" in Search & Replace Metdata dialog | halloleo | Library Management | 8 | 03-08-2020 10:50 PM |
Shortcuts for search & replace clips | celiapgt | Sigil | 2 | 12-11-2016 11:45 PM |
Search & Replace - strange issue | paulfiera | Conversion | 0 | 10-14-2013 02:35 AM |
Search & Replace issue with html entities | Aleyst | Sigil | 2 | 09-27-2011 07:49 AM |
Dialog issue when editing metadata | Manichean | Calibre | 8 | 12-13-2010 01:58 PM |