Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old Yesterday, 05:32 AM   #1
carmenchu
Addict
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
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:
Click image for larger version

Name:	capture_1.jpg
Views:	26
Size:	65.5 KB
ID:	218174Click image for larger version

Name:	capture_2.jpg
Views:	26
Size:	73.4 KB
ID:	218175
--from Clips toolbar, the clip is inserted as a string--capture group not applied
Click image for larger version

Name:	capture_3.jpg
Views:	19
Size:	68.4 KB
ID:	218176Click image for larger version

Name:	capture_4.jpg
Views:	17
Size:	68.6 KB
ID:	218177
Compare with the expected behaviour in code view window
Click image for larger version

Name:	capture_5.jpg
Views:	18
Size:	69.7 KB
ID:	218178Click image for larger version

Name:	capture_6.jpg
Views:	17
Size:	70.1 KB
ID:	218179
With many thanks to all the Sigil developers!
carmenchu is offline   Reply With Quote
Old Yesterday, 07:54 AM   #2
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old Yesterday, 08:29 AM   #3
carmenchu
Addict
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
Quote:
Originally Posted by KevinH View Post
Please show the exact clip used in each case by using the clips editor to show the raw text you are trying to insert.
The clip is the same in all 3 cases:
Code:
Name: ‘’   Text: ‘\1’
1. From clips window to Search o Replace --> behaves like the case 3. in Code View, replacing "nothing" with ‘’ if no selection there
2. From clips toolbar to Search o Replace --> replaces selection with ‘\1’, thus only works for clips like
Code:
Name: center   Text: class="center"
Only works as expected in case 3.--Code View
carmenchu is offline   Reply With Quote
Old Yesterday, 09:26 AM   #4
BeckyEbook
Guru
BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.BeckyEbook ought to be getting tired of karma fortunes by now.
 
BeckyEbook's Avatar
 
Posts: 885
Karma: 3501166
Join Date: Jan 2017
Location: Poland
Device: Various
@KevinH: Look here to reverse issue.
BeckyEbook is offline   Reply With Quote
Old Yesterday, 09:44 AM   #5
carmenchu
Addict
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
Quote:
Originally Posted by carmenchu View Post
The clip is the same in all 3 cases:
Code:
Name: ‘’   Text: ‘\1’
1. From clips window to Search o Replace --> behaves like the case 3. in Code View, replacing "nothing" with ‘’ if no selection there
2. From clips toolbar to Search o Replace --> replaces selection with ‘\1’, thus only works for clips like
Code:
Name: center   Text: class="center"
Only works as expected in case 3.--Code View
N.B.: Issue 1. is common to all clips, while 2. to all intended to capture and reuse the selection.
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...
carmenchu is offline   Reply With Quote
Old Yesterday, 11:04 AM   #6
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old Yesterday, 12:10 PM   #7
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old Yesterday, 12:44 PM   #8
carmenchu
Addict
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
Posts: 200
Karma: 266070
Join Date: Dec 2010
Location: Spain
Device: Win10,Win11,Ubuntu,PockbookLux44
Quote:
Originally Posted by KevinH View Post
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.
Thanks, Kevin.
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.
carmenchu is offline   Reply With Quote
Old Yesterday, 03:45 PM   #9
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 8,972
Karma: 6361444
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by BeckyEbook View Post
@KevinH: Look here to reverse issue.
Thanks, but that code is correct and does not need to be reverted.

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.
KevinH is offline   Reply With Quote
Old Yesterday, 05:19 PM   #10
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Old Today, 03:52 PM   #11
carmenchu
Addict
carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.carmenchu ought to be getting tired of karma fortunes by now.
 
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...
carmenchu is offline   Reply With Quote
Old Today, 05:14 PM   #12
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
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.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
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


All times are GMT -4. The time now is 05:49 PM.


MobileRead.com is a privately owned, operated and funded community.