![]() |
#1 |
Enthusiast
![]() Posts: 39
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. |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Enthusiast
![]() Posts: 39
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. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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?
|
![]() |
![]() |
![]() |
#5 |
Enthusiast
![]() Posts: 39
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. |
![]() |
![]() |
Advert | |
|
![]() |
#6 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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>
|
![]() |
![]() |
![]() |
#7 |
Well trained by Cats
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 30,914
Karma: 60358908
Join Date: Aug 2009
Location: The Central Coast of California
Device: Kobo Libra2,Kobo Aura2v1, 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) |
![]() |
![]() |
![]() |
#8 |
Enthusiast
![]() Posts: 39
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. |
![]() |
![]() |
![]() |
#9 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#10 |
Enthusiast
![]() Posts: 39
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. |
![]() |
![]() |
![]() |
#11 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
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... |
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
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.
|
![]() |
![]() |
![]() |
#13 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
My workflow is not like that. I wouldn't first create a paragraph <p></p> then use ctrl-2 to change it. Thank you. |
|
![]() |
![]() |
![]() |
#14 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,219
Karma: 27110894
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#15 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,611
Karma: 9500498
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Thank you for the modification.
|
![]() |
![]() |
![]() |
|
![]() |
||||
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 |