![]() |
#1 |
Connoisseur
![]() 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. ![]() |
![]() |
![]() |
![]() |
#2 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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? |
![]() |
![]() |
![]() |
#4 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#5 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
A Hairy Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
#7 | |
Connoisseur
![]() Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
Quote:
Now, is there any way to have a button for "set bookmark" besides the "Back" button? |
|
![]() |
![]() |
![]() |
#8 |
Connoisseur
![]() Posts: 77
Karma: 10
Join Date: Apr 2021
Location: Spain
Device: Kobo Libra 2
|
|
![]() |
![]() |
![]() |
#9 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
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. |
![]() |
![]() |
![]() |
#10 | |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 8,439
Karma: 5702578
Join Date: Nov 2009
Device: many
|
Quote:
|
|
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 2,306
Karma: 13057279
Join Date: Jul 2012
Device: Kobo Forma, Nook
|
Sigil 0.9.14.
I've been sitting there for quite a while. Mostly because:
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:
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.) 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. |
![]() |
![]() |
![]() |
#12 |
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 814
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
I vote for keeping the cursor position too.
|
![]() |
![]() |
![]() |
#13 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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.
|
![]() |
![]() |
![]() |
#14 |
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 28,341
Karma: 203719142
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
|
![]() |
![]() |
![]() |
#15 |
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() 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. |
![]() |
![]() |
![]() |
|
![]() |
||||
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 |