Register Guidelines E-Books Search Today's Posts Mark Forums Read

Go Back   MobileRead Forums > E-Book Software > Calibre > Editor

Notices

Reply
 
Thread Tools Search this Thread
Old 09-23-2021, 09:00 AM   #1
shotsky
Enthusiast
shotsky began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2012
Device: none
Feature Request: Move cursor to Preview pane click

Very often, like daily, I use the preview window to look at an epub with an intention to change some headings to something else. This request is for the cursor to show up in the code window at the same point as clicked in the preview pane. Sometimes, it does that, but other times it goes to the start of the line. If you then try to change the heading to, say, <h2 (CTRL-2) a whole section of the ebook is enclosed in the <h2, and the ONLY way out is to undo. And wait. And wait.
Ideally, if I click a character in the preview, the cursor would go to that character. But it would be ok to be anywhere in that line EXCEPT before that line, because in order to change that heading, you not only click in the preview to get to the line, you THEN have to click in the code window inside that line in order to change its heading. If you forget that second step - undo. And wait. And wait.
shotsky is offline   Reply With Quote
Old 09-23-2021, 10:15 AM   #2
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,781
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Whats the wait and wait for? If you accidentally hit ctrl+2 just hit ctrl+z then click inside the tag and hit ctrl+2 again.
kovidgoyal is online now   Reply With Quote
Advert
Old 09-23-2021, 10:59 AM   #3
shotsky
Enthusiast
shotsky began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2012
Device: none
View/Code sync

The problem is that it puts the heading around the whole ebook, not around that line. It takes seconds for it to do that, then seconds again to undo it. I run some pretty large ebooks with lots of photos.
If it would just tag the line itself with the heading, that would also be fine, but it doesn't seem to know where the cursor is, so it starts at the beginning of the book.
shotsky is offline   Reply With Quote
Old 09-23-2021, 11:17 AM   #4
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,781
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Syncing works at tag level, so it will position the cursor at the start of the closest tag containing the text you click. I'm guessing your book is just one long chunk of text with no paragraphs?
kovidgoyal is online now   Reply With Quote
Old 09-23-2021, 11:29 AM   #5
shotsky
Enthusiast
shotsky began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2012
Device: none
No, it is tagged as usual. I think you'd just need to try it and see for yourself. Click in any ebook preview window on a bit of text that you'd like to change the heading of, like a <p line. Watch the cursor go to the front of that line. Use CTRL-2 to try to change that line. It won't change that line, it will put the tags around the whole book. My ebook is only one file, but it is properly formatted html. I just need to change some of the headings, and that's where the problem shows up.
Additionally, I have a few dozen users of my program, and they use Calibre to do the same things that I am doing. With the same results.
It seems like if there are spans in the line, the cursor jumps to the span, which then lets you use the heading changer without issues.
shotsky is offline   Reply With Quote
Advert
Old 09-23-2021, 12:01 PM   #6
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,781
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Works fine for me. Clicking on any text puts the cursor at the start of the <p> tag containing it. I then press the right arrow key once and ctrl-2 and the <p> becomes <h2>
kovidgoyal is online now   Reply With Quote
Old 09-23-2021, 12:10 PM   #7
theducks
Well trained by Cats
theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.theducks ought to be getting tired of karma fortunes by now.
 
theducks's Avatar
 
Posts: 26,649
Karma: 41726679
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Aura2, K4NT(Fixed: New Bat.), Galaxy Tab A
Works for me also.
I do set focus ON the line, first (actually, I set it on Class=, but I also use the Ctrl-click to open/jump the CSS)
theducks is online now   Reply With Quote
Old 09-23-2021, 12:41 PM   #8
shotsky
Enthusiast
shotsky began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2012
Device: none
Yes, I know it works if you move the cursor. That's the point. That's what I always do except when I forget, then the whole undo thing is needed.
The request is for the curser to appear where the line is clicked in the preview. If it just did that, it would be fine. Or, if it would just tag the line as wanted when the cursor is at the beginning of the line, that would also be fine. It is when someone (not just me) forgets to MOVE the cursor into the line that the problem happens.
shotsky is offline   Reply With Quote
Old 09-23-2021, 01:23 PM   #9
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,781
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
Yeah, I'm afraid the sync only happens to the start of the line/tag. Beyond that is not worth the effort to implement, at least for me, patches welcome.
kovidgoyal is online now   Reply With Quote
Old 09-23-2021, 06:46 PM   #10
shotsky
Enthusiast
shotsky began at the beginning.
 
Posts: 37
Karma: 10
Join Date: Jul 2012
Device: none
Ok, it won't be fixed. But isn't it a bug to wrap a whole ebook in one single heading tag? That is an invalid html usage. Divs can enclose a whole ebook, but not a heading.
And, when it happens, you don't see EITHER of the tags - one is at the beginning of the book, the other is at the end of the book, and the user has no idea that it just made illegal html, and is likely to continue on, with a now-broken ebook. I understand the problem, but my users are unlikely to do so.
I'll post a message to them to watch out for this bad behavior and use undo to get out of it.
shotsky is offline   Reply With Quote
Old 09-23-2021, 06:53 PM   #11
Karellen
Connoisseur
Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.
 
Karellen's Avatar
 
Posts: 59
Karma: 174164
Join Date: Sep 2021
Location: Australia
Device: Kindle
I have also noticed the issue the OP mentioned and I quickly got out of the habit of using the ctrl- functions for headings.

Have a look at the image. In this example it is a blank page ready to move text into it. My first step is to create a level <h2> heading.

If I simply place my cursor on an empty line (line 10) to add the tags, then press ctrl-2 I end up with the tags spread as shown in the image...
Attached Thumbnails
Click image for larger version

Name:	h2.jpg
Views:	33
Size:	43.9 KB
ID:	189372  
Karellen is offline   Reply With Quote
Old 09-24-2021, 01:05 AM   #12
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,781
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
The tool is meant to change an existing paragraph to a heading. If you put the cursor outside of any paragraph, the results are undefined. I could possibly make it a bit more intelligent when the cursor is adjacent to a paragraph but not inside one to use the adjacent paragraph, that might help your use case a bit.
kovidgoyal is online now   Reply With Quote
Old 09-24-2021, 01:23 AM   #13
Karellen
Connoisseur
Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.
 
Karellen's Avatar
 
Posts: 59
Karma: 174164
Join Date: Sep 2021
Location: Australia
Device: Kindle
Quote:
Originally Posted by kovidgoyal View Post

The tool is meant to change an existing paragraph to a heading.
Oh right. I thought it was meant to work like the "Insert Tag" option. But, yes I see what happens when using it on an existing paragraph.

My workflow is not like that. I wouldn't first create a paragraph <p></p> then use ctrl-2 to change it.

Thank you.
Karellen is offline   Reply With Quote
Old 09-24-2021, 01:26 AM   #14
kovidgoyal
creator of calibre
kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.kovidgoyal ought to be getting tired of karma fortunes by now.
 
kovidgoyal's Avatar
 
Posts: 39,781
Karma: 17764952
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
https://github.com/kovidgoyal/calibr...e718bf62c847e0
kovidgoyal is online now   Reply With Quote
Old 09-24-2021, 01:39 AM   #15
Karellen
Connoisseur
Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.Karellen can program the VCR without an owner's manual.
 
Karellen's Avatar
 
Posts: 59
Karma: 174164
Join Date: Sep 2021
Location: Australia
Device: Kindle
Thank you for the modification.
Karellen is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Feature request] - Ctrl+Click on classes thiago.eec Editor 20 05-20-2021 07:41 AM
Feature Request - Font Preview Vanguard3000 Sigil 34 03-05-2020 01:00 AM
Wish list - feature requests - Preview Pane GrannyGrump Sigil 9 02-24-2017 02:07 AM
[Feature Request] Setting to stop the mouse cursor being hidden when reading a book hawkins22 Calibre 0 07-11-2016 11:25 AM
Small feature request for Preview window GrannyGrump Sigil 0 03-12-2013 02:57 AM


All times are GMT -4. The time now is 02:13 PM.


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