![]() |
#1 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Special Character highlighting
Hello @kovidgoyal
I am wondering if the following is expected behaviour. I have added a background colour to Special Character as shown in the image. The problem is that the highlighting disappears when the cursor is placed on the same line, so it is a bit like whack-a-mole when trying to edit special characters. Is that meant to happen? See video... https://streamable.com/wqgvey |
![]() |
![]() |
![]() |
#2 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,126
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Its probably conflicting with the current line highlighting, try turning that off.
|
![]() |
![]() |
Advert | |
|
![]() |
#3 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Thanks @kovidgoyal
Sorry I am not sure which is "current line highlighting". Is it "CursorLine" in the custom theme dialogue? It is not set but I clicked the X button to clear it anyway and it made no difference. |
![]() |
![]() |
![]() |
#4 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,126
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
Yes its cursorline the other option is change the special characcter highlight style to use a different foreground color or an underline.
|
![]() |
![]() |
![]() |
#5 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Yep using a foreground colour works in a limited capacity. As long as there is something to display, then it shows that character in a different colour. Unfortunately for non displaying items like em, en etc spaces, there is nothing to colour. Then using an underline is too subtle and either blends into a misspelt word underline, or is just too hard to see at a glance. I guess it's probably too hard to fix the conflict. No problems, I've been working with the issue for quite a while now, so just business as usual. Thought I would raise it in case no-one had come across it before. ![]() Last edited by Karellen; 11-13-2023 at 01:35 PM. Reason: blooper in description |
|
![]() |
![]() |
Advert | |
|
![]() |
#6 | |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 164
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
Quote:
Anyway, if it would be possible to give precedence to the background color of the special chars over the background color of the selected line, it would be helpful. But maybe it's a Qt feature, not a calibre one ? |
|
![]() |
![]() |
![]() |
#7 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,223
Karma: 165616549
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Out of curiosity, what are you doing to make em or en characters non-displaying?
|
![]() |
![]() |
![]() |
#8 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Using one of my snippets, or typing html which then auto-converts. Why, do your space characters display something? |
|
![]() |
![]() |
![]() |
#9 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,223
Karma: 165616549
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
Sorry, I was thinking of the em — and en – dash. An is a non-breaking space though you could also be using  ,  ,  ,  ,  ,   or   for other width spaces and other than the ‍, they do display as spaces of varying width so I don't think of them as non-displaying—I reserve that for characters that have no visible effect such as the ‍.
I seldom using the non-breaking space so I've never worried about seeing them. |
![]() |
![]() |
![]() |
#10 | |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Quote:
Some books I see are littered with unusual spaces, especially the no-break space, for no apparent reason. Some are obvious why they are needed, like the elongated ellipses with spaces between each dot or between nested quotation marks... " 'I quote', he told me!". Most instances have a standard space accompanying it for some reason. So I clean them out. |
|
![]() |
![]() |
![]() |
#11 |
Bibliophagist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 44,223
Karma: 165616549
Join Date: Jul 2010
Location: Vancouver
Device: Kobo Sage, Libra Colour, Lenovo M8 FHD, Paperwhite 4, Tolino epos
|
For characters like the ellipsis, I replace the fake ellipsis with a real one ( . . . vs … ). This does disagree with some stylebooks that suggest either 3 periods with non-breaking spaces or 3 periods with no spacing but I prefer the single ellipsis character.
What is likely my most disliked usage is when every bloody paragraph ends with &160;</p>. Again something that I use saved searches to clean up. One other horrid example was an indie author who decided that they wanted 2 spaces between each sentence so each sentence ended in a <space> pair. |
![]() |
![]() |
![]() |
#12 |
creator of calibre
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 45,126
Karma: 27110892
Join Date: Oct 2006
Location: Mumbai, India
Device: Various
|
|
![]() |
![]() |
![]() |
#13 |
Groupie
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 164
Karma: 1497966
Join Date: Jul 2021
Device: N/A
|
Thanks a lot, Kovid :-)
|
![]() |
![]() |
![]() |
#14 |
Wizard
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 1,590
Karma: 9499994
Join Date: Sep 2021
Location: Australia
Device: Kobo Libra 2
|
Oh wow!! I wasn't expecting a fix.
Thank you @kovidgoyal ![]() |
![]() |
![]() |
![]() |
#15 | |
Fanatic
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 514
Karma: 8500000
Join Date: Aug 2013
Location: Hamden, CT
Device: Kindle Paperwhite (11th gen), Scribe, Kindle 4 Touch
|
Quote:
‍ is for joining two characters that should semantically be one, but cannot be because of Unicode limitations. and ⁠ are the non-breaking companions to the space character and ​. |
|
![]() |
![]() |
![]() |
Thread Tools | Search this Thread |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Special Character Background Colour | BetterRed | Editor | 2 | 12-12-2018 08:03 PM |
Insert special character: some niggles | Phssthpok | Editor | 2 | 11-19-2016 12:55 PM |
"preprocess_regexps with special character ' | scissors | Recipes | 12 | 12-28-2011 03:10 PM |
special character in metadata search | happyuser | Calibre | 1 | 10-19-2011 11:33 AM |
Special Character searches | ElMiko | Calibre | 2 | 09-05-2011 10:52 PM |