[Cuis-dev] [IMPROV] Unicode Input in Editor

Gerald Klix cuis.01 at klix.ch
Fri Jul 28 07:06:48 PDT 2023


Hi Juan,

please see below.

On 7/28/23 3:38 PM, Juan Vuletich wrote:
> Hi Gerald,
>
> On 7/28/2023 6:58 AM, Gerald Klix via Cuis-dev wrote:
>> Hi Juan,
>>
>> Great that you like it.
>>
>> Sometimes I also miss the opportunity
>> to type just \Right for ⇒
>> (who knows by heart that its code-point is 21D2)
>> in text editors.
>> Therefore I am tempted to move this functionality up
>> form SmalltalkEditor to Editor (or TextEditor).
>> Are there only objections from your or the
>> communities side?
>
> Yes. I thought the same when I reviewed your code. A little code 
> duplication could be avoided,  and all of them would be available in 
> any editor. A detail that would be good is what ends the escaped 
> sequence. In your code it is a space. In Luciano's it is anything but 
> a letter. Perhaps anything that but #isAlphaNumeric makes sense.
I know! At first I hacked SmalltalkEditor>#normalCharacter;
needless to say, that the code duplication was even more obvious.

OTH, I decided to swallow the trailing space,
because the intention in to insert characters in a word.
Luciano's code is meant to insert operators, which should be
surrounded by blanks.

I am planning to implement this as follows:
Add two methods to handle the
\operator and the \+unicode cases
to class Editor. Use them both in TextEditor.

Rationale:
Don't load the base editor (Editor) with this
functionality. Someone subclassing it might not want it.
But someone may want a very simple editor
directly derived from Editor, but with some
Unicode input feature. Therefore add these
methods to Editor.
>
>
>>
>> While I am talking/writing about it:
>> There is no way to discover all the available
>> backslash-shortcuts, unless you dig deep and find
>> UnicodeCodePoint class>>#initializeNamedCharactersMap.
>> It would be nice if code completion will cover
>> these cases.
>
> That would be nice. Not sure how complicated it would be, though.
Some strategically placed halts/breaks, revealed that the
entries the AutoCompleter computes is just an OrderedCollection of strings.
If the auto-completer is not able to compute any entries,
we could check for a backslash and compute suitable entries.
This should work, because something like "\abcd" is either invalid Smalltalk
syntax or inside a string.
Currently in both cases there are no valid completions,
therefor there is no ambiguity: Either we compute completions for code
or we compute completions for Unicode-input.
>
>>
>> Just my 0.01€,
>>
>> Gerald
>
> Thanks,
>
You are welcome.


Best Regards,

Gerald


More information about the Cuis-dev mailing list