Editor search: searching for auto-replaced characters
Entering text, text automation is applied (for example auto-replace straight single quotes if enabled). This auto-replace does not happen in the editor search box (and in the global search box).
In short: typing didn't in the search box, doesn't find didn’t.
My workaround to search for didn’t is:
- type
didn’tin the editor - cut/paste to search box
Probably the search boxes should follow the auto-replace setting.
This is an interesting topic.
To see how it is done elsewhere, I just checked LibreOffice Writer 7.6. If I follow the example shown above, the input I didn't actually finds the text I didn’t with the automatically corrected apostrophe. This works without modifying the search box content. However, this isn't working with quotation marks and dashes.
This is not possible at all with older versions such as OpenOffice 3.4; here you must always enter the correct typographic characters.
However, I would like to point out one thing: If the search string is modified by the program, it will no longer be possible to subsequently replace such special characters, for example for imported text or text pasted via the clipboard.
Yeah, I'm not sure I like the idea of auto-replacing the content of the search box, although I can absolutely see the problem you're facing. Since the editor search feature is just hooking into the Qt search feature, I can't really control how it matches it either.
The search feature is primarily meant to be triggered by selecting a piece of text and then initiating the search, which will auto-populate it with the selected text. Of course, this doesn't work so well if you don't have a location from which to start the search.
You can insert the desired symbols from the Insert menu, but it doesn't allow insertion into the search box. Maybe allowing that would be a better way to fix. As a Linux user I can already type all of these characters from my keyboard either with AltGr or the Compose key, so I don't generally encounter this as a problem.
Either way, the search results (or the lack of them) can be misleading, but once you're aware what's going on, there are always workarounds (good memory for character codes, or copy/paste).
If you type ' in the editor, and get ’, I think it's more intuitive for most people if the search box acts the same way.
Addendum: was also looking for inconsistent use of dashes recently, had to use copy/paste workaround to enter them in the search box (-- or --- didn't work).
Well, as I said, the auto-replace doesn't apply to the search box, which implies dashes, ellipsis, etc, too.
As @peter88213 points out, allowing auto-replace makes it harder to type an actual straight single or double quote, so either way it's going to affect some use case or another.
@awqk: What might also help you is searching with regular expressions. didn.t should find both didn't and didn’t.
Addendum: was also looking for inconsistent use of dashes recently, had to use copy/paste workaround to enter them in the search box (-- or --- didn't work).
This is a good argument for not using auto-replace at all and doing the final formatting either during the export or after the export. I have written extensions for LibreOffice and OpenOffice that do this with a single command. This also makes it possible to switch between the styles of different languages or to convert all special typographic characters back to the “typewriter style” at once.
Yes, it may be a good idea to add support for quote formatting in the Manuscript tool as an alternative to the auto-replace feature. It could also apply to dashes. However, the dialogue highlighter feature depends on these symbols, so parts of it would not work.