Register Guidelines E-Books Today's Posts Search

Go Back   MobileRead Forums > E-Book Software > Sigil

Notices

Reply
 
Thread Tools Search this Thread
Old 11-14-2022, 06:10 AM   #1
repilo
Connoisseur
repilo began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
Loss of cursor position after a search

Sorry for my poor English. I hope the translation software doesn't betray me too much or make me sound rude or picky.

Suppose I am editing line 230 of chapter 1 of an ePub.
Then I see that I need to look up or check something elsewhere in the book, so I search for a certain word or phrase.
If the search is successful and finds that phrase in another chapter, when I go back to chapter 1 to continue editing, I find the cursor on the first line of the file: I have lost the editing position.
If the search is unsuccessful, the cursor also goes to the beginning of the file.

I guess this must be a bug. I would like the cursor position not to be lost, except in the inevitable event that the search is successful in the same file I am editing, and in which case it would be helpful if there were a button to return to the previous cursor position.

Thanks for your amazing work.
repilo is offline   Reply With Quote
Old 11-14-2022, 09:02 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,439
Karma: 5702578
Join Date: Nov 2009
Device: many
Not a bug. That is just how search in Sigil is designed.

Cursors determine search start points but a search can end up someplace else resetting the cursor. For example: If you search the current file and found what you were searching for later in the same file, the cursor position would change to where you found it.

If you tell it to search all xhtml files, it will cycle through each file starting at the top of each file (or bottom if direction is set to up) ignoring the current cursor if one exists as the starting point. That includes the top of the current file (before your cursor) if it is an xhtml file.

You can set a bookmark before any search (see the find replace menu) if you want to quickly return to where you started, by using the back button.

If you search in the current file up or down and nothing is found, the cursor remains unchanged.

Last edited by KevinH; 11-14-2022 at 12:26 PM.
KevinH is offline   Reply With Quote
Advert
Old 11-14-2022, 01:59 PM   #3
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,439
Karma: 5702578
Join Date: Nov 2009
Device: many
That said, if this is generally expected behaviour even when searching over multiple files (ie searching over all xhtml files) when nothing at all is found in any of them, we could modify Sigil to act like that.

Obviously if something is found in the current file (or any other) the active tab and cursor will be moved.

What do people think?
KevinH is offline   Reply With Quote
Old 11-14-2022, 02:24 PM   #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: 808
Karma: 2416112
Join Date: Jan 2017
Location: Poland
Device: Various
Sounds good.
I can imagine that I check the spelling of some place name or character name and make adjustments file by file, so losing the cursor position on a failed search can be a nuisance.
BeckyEbook is offline   Reply With Quote
Old 11-14-2022, 02:36 PM   #5
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,439
Karma: 5702578
Join Date: Nov 2009
Device: many
To be clear:

Searching using "current file" mode already works like that. In other words if nothing is found, then the cursor remains unchanged. So you could manually search many files one by one that way.

Only when search mode is set to a multiple file grouping: all css, all xhtml, selected css, tabbed css, selected html, tabbed html, does the cursor move to the top of the file if nothing is found anywhere. This happens because the last place it searches is the top (above the cursor) in the current file (assuming the search direction is down) to literally check everything.

We could handle that as a special case if that is what people expect it to do when searching in multiple file mode and finding nothing.

Last edited by KevinH; 11-14-2022 at 02:46 PM.
KevinH is offline   Reply With Quote
Advert
Old 11-14-2022, 02:37 PM   #6
Turtle91
A Hairy Wizard
Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.Turtle91 ought to be getting tired of karma fortunes by now.
 
Turtle91's Avatar
 
Posts: 3,295
Karma: 20171067
Join Date: Dec 2012
Location: Charleston, SC today
Device: iPhone 15/11/X/6/iPad 1,2,Air & Air Pro/Surface Pro/Kindle PW & Fire
I concur, doctor.

If it doesn’t find anything elsewhere, then it would be nice to keep its current position.
Turtle91 is offline   Reply With Quote
Old 11-14-2022, 03:53 PM   #7
repilo
Connoisseur
repilo began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
Quote:
Originally Posted by KevinH View Post
You can set a bookmark before any search (see the find replace menu) if you want to quickly return to where you started, by using the back button.
Ok. I will set a bookmark before searching (menu Search->Bookmark_Location). And I will click the "<-" button to return to this position.
Now, is there any way to have a button for "set bookmark" besides the "Back" button?
repilo is offline   Reply With Quote
Old 11-14-2022, 04:01 PM   #8
repilo
Connoisseur
repilo began at the beginning.
 
Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
Quote:
Originally Posted by Turtle91 View Post
I concur, doctor.

If it doesn’t find anything elsewhere, then it would be nice to keep its current position.
For me it would be nice to keep the position in a tab also when you find something in another tab.
repilo is offline   Reply With Quote
Old 11-14-2022, 04:44 PM   #9
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by KevinH View Post
Not a bug. That is just how search in Sigil is designed.
I'd agree with repilo.

Searching all files + 0 hits shouldn't move the cursor.

(This is how old Sigil worked + I haven't tested the newer versions of Sigil.)

This is how all other programs (like LibreOffice, Notepad++, Sublime Text, etc.) work too... To constantly pop back up to the top of the file sounds like very poor user experience.
Tex2002ans is offline   Reply With Quote
Old 11-14-2022, 05:24 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,439
Karma: 5702578
Join Date: Nov 2009
Device: many
Quote:
Originally Posted by Tex2002ans View Post
I'd agree with repilo.

Searching all files + 0 hits shouldn't move the cursor.

(This is how old Sigil worked + I haven't tested the newer versions of Sigil.)

This is how all other programs (like LibreOffice, Notepad++, Sublime Text, etc.) work too... To constantly pop back up to the top of the file sounds like very poor user experience.
It has worked that way for the last couple of years. Just how far back with Sigil are you? And more importantly why?
KevinH is offline   Reply With Quote
Old 11-14-2022, 06:11 PM   #11
Tex2002ans
Wizard
Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.Tex2002ans ought to be getting tired of karma fortunes by now.
 
Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
Quote:
Originally Posted by KevinH View Post
Just how far back with Sigil are you? And more importantly why?
Sigil 0.9.14.

I've been sitting there for quite a while. Mostly because:
  • I had a major multi-month long project going on.
  • I needed Book View for some cleanup things.
    • Syncing between Preview<->Code View at the time was very annoying.
    • PageEdit wasn't a full-on replacement of Book View yet.

Besides that, it's mostly been major project after major project, so I haven't dug deep into the innards of Sigil 1.0+ yet.

- - -

Then, with Sigil 1.0+...

I have a VM where I poke around new versions of Sigil to:
  • Take a few screenshots
    • for tutorials / info for new users.
  • + Mess with some of the latest doodads (like updated Reports + Multi-Language spellchecking) to make sure they work okay.

In the VM, I only do very small steps. Nothing major like running all my Saved Searches + entire ebook cleanups, so I don't tend to catch workflow oddities like this.

(I also wasn't a big fan of those new icons + some of the major GUI/UX changes, but I see that's been tweaked a little in most recent versions.)

Quote:
Originally Posted by KevinH View Post
It has worked that way for the last couple of years.
If I was poking around and doing actual conversions in the newer versions, I probably would've reported similar way back when this change first got introduced!

Last edited by Tex2002ans; 11-14-2022 at 06:13 PM.
Tex2002ans is offline   Reply With Quote
Old 11-14-2022, 06:21 PM   #12
icallaci
Guru
icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.icallaci ought to be getting tired of karma fortunes by now.
 
Posts: 814
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
I vote for keeping the cursor position too.
icallaci is offline   Reply With Quote
Old 11-14-2022, 06:25 PM   #13
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,439
Karma: 5702578
Join Date: Nov 2009
Device: many
Well it seems to be unanimous among those that posted. I will get something that works and push it to master for the next release.
KevinH is offline   Reply With Quote
Old 11-14-2022, 06:54 PM   #14
DiapDealer
Grand Sorcerer
DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.DiapDealer ought to be getting tired of karma fortunes by now.
 
DiapDealer's Avatar
 
Posts: 28,341
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
Quote:
Originally Posted by KevinH View Post
Well it seems to be unanimous among those that posted. I will get something that works and push it to master for the next release.
Be careful. You could open a can of worms!
DiapDealer is offline   Reply With Quote
Old 11-14-2022, 10:43 PM   #15
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,439
Karma: 5702578
Join Date: Nov 2009
Device: many
Yes, I do not want to open any cans of worms or create any monsters!

That said, I have created a "fix" and pushed it to master for the next release. Further testing is needed to make sure there are no side effects but initial testing indicates it works.
KevinH is offline   Reply With Quote
Reply


Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Plugin to insert text at current cursor position MandyBrigwell Plugins 26 09-05-2021 11:50 AM
Get cursor position or highlighted text inside plugin otherpasserby Plugins 10 12-16-2018 05:40 AM
How to send cursor to the home position by code ? reinsley Library Management 4 02-25-2017 02:08 PM
lack of syncronization and loss of cursor positon Genesis Sigil 14 04-27-2012 12:56 PM
Loss of Cursor Viewing Sony ebook library V3 Vienna01 Sony Reader 0 12-10-2009 12:17 AM


All times are GMT -4. The time now is 12:51 PM.


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