|
|
#31 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Did you read my explanation, that would require linking Sigil with the ICU lib which would necessitate adding 31meg of code and data to an already huge Sigil app or hugely slow down editing by calling into the python interpreter after every single keystroke.
If there was a just a limited set of character names that everyone was interested in seeing that would be different. So this suggestion "as made" is not gonna happen. The closest approximation I could get would be a button, icon, or menu that a user would need to trigger to display the character name someplace like the status bar. But this would be done only on user request and not automatically after every keystroke in the editor as it would require calling into the python interpreter. So maybe a new menu item: "Inspect Character" that would report the name of the character? Slower and requiring user interaction but doable without the huge file size penalty or loss of editing speed. Any interest in that? Last edited by KevinH; 01-13-2026 at 12:56 PM. |
|
|
|
|
|
#32 | |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Quote:
Code:
<?xml version='1.0' encoding='utf-8'?> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title>Calibre Quick Start Guide</title> <link href="../styles/stylesheet.css" rel="stylesheet" type="text/css"/> </head> <body> <h1 class="center" id="introduction">Introduction</h1> <p class='><a href="https://calibre-ebook.com/">Calibre</a> is an <a href="https://www.opensource.org/">open source</a> e-book management tool. Simply put, calibre allows you to organize your e-book library, convert e-books to various formats, and interact with your e-book reader, all in an intuitive and friendly manner. It is compatible with Microsoft Windows 8 onwards – as well as Apple’s macOS (and various flavors of Linux). It was created by Kovid Goyal, who still leads its development. A number of people around the world, including myself, contribute to calibre’s development. Throughout this guide and the online docs you will see ‘calibre’ instead of ‘Calibre’. That’s the convention Kovid chose, so that’s what we use.</p <p>The purpose of calibre is to simplify management of your e-book library. It does this in several ways:</p> </body> </html> Now, there is no syntax highlighting for either being presented to me by calibre. There is nothing to indicate the errors in the syntax highlighting. Is there a preferences or setting I must change to enable it? Next if I run Check Book, it only detects the first error and if I let it autofix, then it ends up removing the entire paragraph! Instead in Sigil: if you run the same test on the same xhtml and run the Well Formed check the error message says: Code:
OEBPS/Text/Section0001.xhtml 11 N/A Attribute "class" has unmatched quotes on attribute value. near column 2 This page contains the following errors: error on line 11 at column 14: Unescaped '<' not allowed in attributes values error on line 13 at column 3: Unescaped '<' not allowed in attributes values error on line 14 at column 1: Unescaped '<' not allowed in attributes values error on line 15 at column 8: AttValue: ' expected Below is a rendering of the page up to the first error. So I am not sure how the calibre Editor is making things any easier or doing the requested syntax highlighting of error locations. What am I missing? Last edited by KevinH; 01-13-2026 at 07:15 PM. |
|
|
|
|
| Advert | |
|
|
|
|
#33 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
As a test, I can have implemented the show character name request in a quick and dirty manner and can actually call into the python interpreter and use unicodedata to get a non-control characters name.
Since every key you type in CodeEditor will change cursor positions, you would have to make this call into the python library once for every single key typed! It is doable on a fast machine with a slow typist, but I shudder to think what this would do for a fast typer on an old machine. I will try adding a timer and only on timeout adding in the character name. So a user would have to pause their typing briefly so that the timeout fires and the latest character name has time to appear. But trying to read that status bar when constantly typing doesn't really work anyway. This would necessitate creating a separate name label in the status bar and making a MainWindow member variable to hold the result of the timer firing. I will keep playing around with this to workaround the slower bridge speed to launch python calls or by limiting the timing and number of calls to keep editing with the keyboard fast. Last edited by KevinH; 01-13-2026 at 05:20 PM. |
|
|
|
|
|
#34 | |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 823
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
Quote:
|
|
|
|
|
|
|
#35 |
|
Evangelist
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 460
Karma: 3886916
Join Date: May 2013
Location: Ontario, Canada
Device: Kindle KB, Oasis, Pop_Os!, Kobo Forma
|
I too like the idea of a way to inspect a character when needed. I work with some quite old files sometimes, or multilingual documents, and this would be very handy.
|
|
|
|
| Advert | |
|
|
|
|
#36 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Do people care if it is the character immediately before the cursor or immediately after the cursor? The latter option matches where the cursor position actually indicates.
|
|
|
|
|
|
#37 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 823
Karma: 6528026
Join Date: Sep 2012
Device: Kobo Elipsa
|
I personally don't care if the cursor is before or after the character. In calibre, the cursor is immediately after the character in question, but I can live with either one.
|
|
|
|
|
|
#38 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 928
Karma: 3501168
Join Date: Jan 2017
Location: Poland
Device: Various
|
Definitely the character immediately before the cursor.
|
|
|
|
|
|
#39 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Okay, I built a singleton instance that builds its own codepoint name cache using python before the MainWindow is launched. This allows the codepoint name process to get fast enough to show the character name for every key typed.
It updates as it goes along. So I will add that to Sigil so that users who build their own can report back about it. I hope to push these changes to master by tonight. |
|
|
|
|
|
#40 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Why? Could you provide an argument for that "before" being better than "after" that doesn't include "just to match calibre".
If you want before the cursor, then what do you return when the cursor is at the very start of the line then? When at the end of the line there is always the new line char if you go with the character after the cursor. Before the cursor just seems strange to me. Last edited by KevinH; 01-14-2026 at 03:43 PM. |
|
|
|
|
|
#41 |
|
Grand Sorcerer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 29,032
Karma: 210162574
Join Date: Jan 2010
Device: Nexus 7, Kindle Fire HD
|
RTL languages would be the only thing I can think of that would make "before the cursor" make any sense. But that would be the exception rather than the rule I would think. I too see no real sense in what's going on behind the cursor. *shrug*
Last edited by DiapDealer; 01-14-2026 at 03:47 PM. |
|
|
|
|
|
#42 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
And to add to the "after insertion point cursor" argument, if you convert to a block cursor, the flashing character under the block cursor is the one after the insertion point cursor, not before it. So the character "under the cursor" is technically the one after the insertion point cursor.
Last edited by KevinH; 01-14-2026 at 06:02 PM. |
|
|
|
|
|
#43 |
|
Guru
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 928
Karma: 3501168
Join Date: Jan 2017
Location: Poland
Device: Various
|
You're right, I wrote the exact opposite of what I wanted to say. When we place the cursor in the text, it will be obvious that the information is about the NEXT character.
|
|
|
|
|
|
#44 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Whew! Glad we all agree!
I will push those changes to master tomorrow morning for people to play around with and suggest changes to. |
|
|
|
|
|
#45 |
|
Sigil Developer
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Posts: 9,246
Karma: 6565382
Join Date: Nov 2009
Device: many
|
Okay, I have pushed the latest version of "displaying a character name" requested feature to master.
It uses a cache for each codepoint to store its name and python routines to use unicodedata.name() to lookup codepoints not yet in the cache. The cache is preloaded with the names of the standard ascii characters heavily used in css and xhtml. This helps speed up editing. If anyone builds there own, I am looking for feedback on this feature request: 1. Do you notice any editing slowdown related to this change? Editing speed may especially be an issue for editing text in a language that does not make heavy use of standard ascii characters (that xhtml and css uses) in its text (due to pre-caching). So if you can test that and report back, that would be helpful. 2. Instead of displaying it after each every cursor change, would you instead prefer an "Inspect Character" menu item and removal of this status bar addition? Note: Master also includes: 1) a fix for a python name collision in the SigilMatch that impacts Python Function Replace 2) the addition of a way to export selected rows of the SpellcheckEditor to a CSV file (using a right click pop-up menu) Feedback on either of those two changes also welcome. Last edited by KevinH; 01-15-2026 at 12:57 PM. |
|
|
|
![]() |
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Suggestions for Sigil Improvements or New Features | KevinH | Sigil | 168 | 11-18-2025 01:23 PM |
| Suggestions for New Plugins and Plugin Improvements | KevinH | Plugins | 0 | 09-22-2025 11:53 AM |
| Ideas for New Improvements or Features | KevinH | Sigil | 97 | 04-09-2025 10:45 AM |
| Improvements/bugs/features | dontcrash | KOReader | 10 | 10-23-2019 11:05 AM |
| Onyx M92: Suggestions for possible improvements | Lode | Onyx Boox | 3 | 02-11-2013 08:40 AM |