You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have some thoughts about unicode-input improvements that I would like to discuss.
Maybe they can improve working with non-ascii characters.
99% of the times when I type a1, b1, h2, ..., I mean a₁, b₁, h₂. Maybe such replacements could happen automatically, when a1, b1, ... does not appear anywhere in the current document, but a₁, ... does? Should be easy to implement with an index of all words (i.e. \S+) in the current document. It would be nice if declaration vs usage could be distinguished, but I guess this will only be possible with Lean 4.
I think it might be sensible to replace <-> and -> automatically with their unicode equivalent. (See next point)
Many abbreviations are not prefix-free, i.e. there are abbreviations a and ab such that a is a prefix for ab. This means that when \a has been typed, it could be extended to \ab. Abbreviations that don't have such an extension can be replaced immediately when the last character is inserted. Maybe this can also be implemented for abbreviations that actually have an extension (like \<->)? The replacement would be temporarily and needs to be reverted when another character is added. Maybe some ~300ms timeout could be used to defer replacement of extendable abbreviations.
What do you think?
The text was updated successfully, but these errors were encountered:
First, thanks for thinking about the extension! There are certainly lots of improvements that could be made; I think many of the UX decisions up to now have been governed more by ease of implementation / hacks rather than by any principled decisions.
In my opinion, (1) and (2) sound a bit too much like magic to me to have them always on by default, but they seem like reasonable optional settings. (3) sounds interesting; I like the first part of (3) more than the second, but I'd have to test it out to be sure.
A large community of Lean users hangs out at the Lean prover community Zulip, so you may get more comments if you post there.
I have some thoughts about unicode-input improvements that I would like to discuss.
Maybe they can improve working with non-ascii characters.
99% of the times when I type
a1
,b1
,h2
, ..., I meana₁
,b₁
,h₂
. Maybe such replacements could happen automatically, whena1
,b1
, ... does not appear anywhere in the current document, buta₁
, ... does? Should be easy to implement with an index of all words (i.e.\S+
) in the current document. It would be nice if declaration vs usage could be distinguished, but I guess this will only be possible with Lean 4.I think it might be sensible to replace
<->
and->
automatically with their unicode equivalent. (See next point)Many abbreviations are not prefix-free, i.e. there are abbreviations
a
andab
such thata
is a prefix forab
. This means that when\a
has been typed, it could be extended to\ab
. Abbreviations that don't have such an extension can be replaced immediately when the last character is inserted. Maybe this can also be implemented for abbreviations that actually have an extension (like\<->
)? The replacement would be temporarily and needs to be reverted when another character is added. Maybe some ~300ms timeout could be used to defer replacement of extendable abbreviations.What do you think?
The text was updated successfully, but these errors were encountered: