Bug 147681 - Autotext replacement not willing to ignore parenthesis before shortcut "---"
Summary: Autotext replacement not willing to ignore parenthesis before shortcut "---"
Status: NEW
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: AutoText
  Show dependency treegraph
 
Reported: 2022-02-26 23:18 UTC by Eyal Rozenberg
Modified: 2023-07-01 18:07 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Eyal Rozenberg 2022-02-26 23:18:53 UTC
Suppose I have some autotext entry with a certain shortcut (e.g. ---). 

If I type in that shortcut and press F3, it should be replaced with the autotext entry (well, that and the gratuitous newline, see bug 53023).

However, if, before the shortcut, I have a parenthesis character rather than a space (or nothing), - F3 will not be match my shortcut and I'll get an error message.
Comment 1 Dieter 2022-03-13 10:23:14 UTC
I can't confirm it with

Version: 7.4.0.0.alpha0+ (x64) / LibreOffice Community
Build ID: 51fb84829afbc1c0957fd1a489085613ad199f1a
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL

Example:(DT + F3 inserts dummy text behind parenthesis
Comment 2 Eyal Rozenberg 2022-03-13 18:49:02 UTC
(In reply to Dieter from comment #1)
> Example:(DT + F3 inserts dummy text behind parenthesis

Try it with a shortcut of three minus signs please.
Comment 3 Dieter 2022-03-14 07:43:32 UTC
I confirm it with shortcut "---" So it's not a general problem with shortcuts but with special one (Assumption: If you combine letters and non-letters LO will ony trest letters as shortcut. If you combine non-letters LO will treat all characters as a shortsut).

Version: 7.3.2.1 (x64) / LibreOffice Community
Build ID: 0b2e59a88b7e225b655db87910f97dca7aef27aa
CPU threads: 4; OS: Windows 10.0 Build 19044; UI render: Skia/Raster; VCL: win
Locale: de-DE (de_DE); UI: en-GB
Calc: CL
Comment 4 Eyal Rozenberg 2022-03-14 09:43:38 UTC
Just adding some motivation: I use some non-letter shortcuts to insert characters without keyboard keys, e.g. ---  for em-dash, -> for right-arrow etc. This could theoretically be achieved with autocorrect, but one might want fine-grained control, or otherwise need to avoid autocorrect.
Comment 5 Dieter 2022-03-14 09:48:44 UTC
I understand the use case, but I also think, that autocorrect is the more appropriate solution.
Comment 6 Stéphane Guillou (stragu) 2023-07-01 18:07:16 UTC
Confirmed that AutoText will use the closest string of non-space characters that's only composed of either alphanumeric characters _or_ special characters.
Note that using Ctrl + Shift + Left arrow will also select the full ")---".

OOo 3.3 would also catch the full ")---", so marking as inherited.

Mike, after your work on bug 126589, what are your thoughts?

Deciding what constitute a boundary or not in a series of non-alphanum will always be debatable[1], so the only way out as I understand it is to:

(a) keep adding characters to the string and checking if it matches a shortcut until it does or it reaches a space or alphanum character. Sounds like a pretty bad hack, but could work?

Alternatively:
(b) Stop accepting some boundary characters in new shortcuts (which ones? and would break existing shortcuts, so not workable.)
(c) Won't fix.

[1] What happens if I want my shortcut to be ")))" ? It's currently accepted in the shortcut field.