Fixing tab behaviour and browser hierarchy appearance

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
28 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Fixing tab behaviour and browser hierarchy appearance

Eliot Miranda-2
Hi Marcel,

    I'm having a go at fixing the tabbing indent behavior.  I can't live with selecting interior text (text that is past some sequence of whitespace at the beginning of a line), typing tab to replace the selection with tabs, and have the line indent instead.  If people want the indent all they have to do is select within whitespace at the beginning of the line.

However, when I opened up the browser to inspect the Editor, TextEditor, SmalltalkEditor hierarchy I was misled into thinking that SmalltalkEditor was a sibling of TextEditor rather than its subclass because SmalltalkEditor is indented so little w.r.t. TextEditor.

To reproduce, open up a browser and navigate to Morphic-Text Support, then look at TextEditor and SmalltalkEditor.  I think you'll agree that the indent needs to be larger.

I'll fix tab indenting if you fix browser indenting ;-)

_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

marcel.taeumel
Hi Eliot,

Chris modified indenting and outdenting so that you can select a text multi (multiple lines also) and hit TAB to indent or SHIFT+TAB to outdent. I like this feature.

Should we make it optional? (Prior to this, it was CMD+SHFT+L/R).

---

Yes, this T as a parent from S is really confusing. The vertical bar of the T is indented almost so much that it hits the left bound of the S. But it's an illusion brought to you by the current font.

What about making the indent just a little bit more obvious? Adding more spaces? =)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-3
> Chris modified indenting and outdenting so that you can select a text multi
> (multiple lines also) and hit TAB to indent or SHIFT+TAB to outdent. I like
> this feature.
>
> Should we make it optional? (Prior to this, it was CMD+SHFT+L/R).

Maybe my change should be that the Control key is required.  So,
Control+Tab for indent, Control+Shift+Tab for outdent, recovering Tab
as a regular character for replacement of a selection.

I must admit, I've found myself doing exactly what Eliot did; pressing
Tab to replace a selection of code.  Just an old habit.

I do think I could retrain that habit without much difficulty.  I can
either just press backspace (or delete), okay, its one extra key, OR,
since I use the code formatter anyway, simply don't worry about
formatting when writing.  Just let the thoughts stream out my fingers
as fast as I can type, llet the machine format it when I save:
Cmd+S+s (format, save).

I think restoring the behavior Eliot wants and requiring Control is a
good solution.  Manual indenting is such a rare and direct thought
anyway -- and when one is doing that, they aren't thinking about their
own stuff.  That's a fine time to have to press the Control key.

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-3
In reply to this post by Eliot Miranda-2
There's another use-case that's affected as well:  copy and pasting
code out of an email into a workspace and wanting to use
search-and-replace to change 4 spaces back to Tabs.  Because there is
a selection, it thinks you want to indent that line instead of replace
it with a Tab character.

The only way to do it now is to copy a tab into the clipboard and
paste it as the replacement.  That's too onerous..

On Wed, Nov 18, 2015 at 1:20 PM, Eliot Miranda <[hidden email]> wrote:

> Hi Marcel,
>
>     I'm having a go at fixing the tabbing indent behavior.  I can't live
> with selecting interior text (text that is past some sequence of whitespace
> at the beginning of a line), typing tab to replace the selection with tabs,
> and have the line indent instead.  If people want the indent all they have
> to do is select within whitespace at the beginning of the line.
>
> However, when I opened up the browser to inspect the Editor, TextEditor,
> SmalltalkEditor hierarchy I was misled into thinking that SmalltalkEditor
> was a sibling of TextEditor rather than its subclass because SmalltalkEditor
> is indented so little w.r.t. TextEditor.
>
> To reproduce, open up a browser and navigate to Morphic-Text Support, then
> look at TextEditor and SmalltalkEditor.  I think you'll agree that the
> indent needs to be larger.
>
> I'll fix tab indenting if you fix browser indenting ;-)
>
> _,,,^..^,,,_
> best, Eliot
>
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

marcel.taeumel
Do Eliots recent changes work fine? Seems so. :)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-3
They actually don't.  Are you against Control+Tab for indent?


On Wed, Nov 18, 2015 at 3:30 PM, marcel.taeumel <[hidden email]> wrote:

> Do Eliots recent changes work fine? Seems so. :)
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/Fixing-tab-behaviour-and-browser-hierarchy-appearance-tp4861769p4861820.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Nicolai Hess-3-2


2015-11-18 22:54 GMT+01:00 Chris Muller <[hidden email]>:
They actually don't.  Are you against Control+Tab for indent?

Control+Tab does not work well on windows. (VM does not generate a keychar event for this key combination).
 


On Wed, Nov 18, 2015 at 3:30 PM, marcel.taeumel <[hidden email]> wrote:
> Do Eliots recent changes work fine? Seems so. :)
>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/Fixing-tab-behaviour-and-browser-hierarchy-appearance-tp4861769p4861820.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>




Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Levente Uzonyi-2
In reply to this post by marcel.taeumel
On Wed, 18 Nov 2015, marcel.taeumel wrote:

> Do Eliots recent changes work fine? Seems so. :)

Shift+Tab doesn't work at all.
Tab doesn't work when the first selected character is not a whitespace.

The common solution is that Tab replaces the selection when it's within a
single line, and indents when it spans over multiple lines.
I think that's what we should implement as well.
Shift+Tab is fine to unindent in all cases, because we don't expect
replacement for that key combination.

Levente

>
> Best,
> Marcel
>
>
>
> --
> View this message in context: http://forum.world.st/Fixing-tab-behaviour-and-browser-hierarchy-appearance-tp4861769p4861820.html
> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Eliot Miranda-2
In reply to this post by Chris Muller-3


> On Nov 18, 2015, at 1:54 PM, Chris Muller <[hidden email]> wrote:
>
> They actually don't.  Are you against Control+Tab for indent?

Are you sure?  I had one bug and I fixed it.  I think what's there now works fine.

>
>
>> On Wed, Nov 18, 2015 at 3:30 PM, marcel.taeumel <[hidden email]> wrote:
>> Do Eliots recent changes work fine? Seems so. :)
>>
>> Best,
>> Marcel
>>
>>
>>
>> --
>> View this message in context: http://forum.world.st/Fixing-tab-behaviour-and-browser-hierarchy-appearance-tp4861769p4861820.html
>> Sent from the Squeak - Dev mailing list archive at Nabble.com.
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-3
In reply to this post by Levente Uzonyi-2
On Wed, Nov 18, 2015 at 4:08 PM, Levente Uzonyi <[hidden email]> wrote:
> On Wed, 18 Nov 2015, marcel.taeumel wrote:
>
>> Do Eliots recent changes work fine? Seems so. :)
>
>
> Shift+Tab doesn't work at all.

It doesn't work on Linux.  It _does_ work on Windows.  Not sure about
Mac (someone confirm?).  Strangely, Control+Tab does NOT work on
Windows.

My hope is that this is a trivial VM fix so that Squeak can have
access to that key.  Lets design our vision of ideal for the image,
and then we'll have it once the VM gets fixed.  Of course, we better
check with Eliot about that..   :)

Eliot, if there's no hope of having Shift[+Control]+Tab detection on
all platforms, then we should wish to consider other options...

> Tab doesn't work when the first selected character is not a whitespace.

Agree, because that's when I actually WANT replacement via the Tab
character, not indentation.

Almost like if Eliots change were reversed I might like it better..
Putting Tab in the midddle of a line seems much rarer than the
beginning...

Still, IF Control+Tab worked, that would be the idea solution.

> The common solution is that Tab replaces the selection when it's within a
> single line, and indents when it spans over multiple lines.

Not sure, it seems just as likely to want to select entire multi-line
expressions and wnat to replace them iwth new expressions, starting
with a Tabular indentation...

> I think that's what we should implement as well.
> Shift+Tab is fine to unindent in all cases, because we don't expect
> replacement for that key combination.

Agree there, if only the key worked...

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Levente Uzonyi-2
On Wed, 18 Nov 2015, Chris Muller wrote:

> On Wed, Nov 18, 2015 at 4:08 PM, Levente Uzonyi <[hidden email]> wrote:
>> On Wed, 18 Nov 2015, marcel.taeumel wrote:
>>
>>> Do Eliots recent changes work fine? Seems so. :)
>>
>>
>> Shift+Tab doesn't work at all.
>
> It doesn't work on Linux.  It _does_ work on Windows.  Not sure about
> Mac (someone confirm?).  Strangely, Control+Tab does NOT work on
> Windows.
>
> My hope is that this is a trivial VM fix so that Squeak can have
> access to that key.  Lets design our vision of ideal for the image,
> and then we'll have it once the VM gets fixed.  Of course, we better
> check with Eliot about that..   :)
>
> Eliot, if there's no hope of having Shift[+Control]+Tab detection on
> all platforms, then we should wish to consider other options...

In an ideal system you can change the key bindings the way you want. So
we should find a way to avoid hardcoding them.

>
>> Tab doesn't work when the first selected character is not a whitespace.
>
> Agree, because that's when I actually WANT replacement via the Tab
> character, not indentation.
>
> Almost like if Eliots change were reversed I might like it better..
> Putting Tab in the midddle of a line seems much rarer than the
> beginning...
>
> Still, IF Control+Tab worked, that would be the idea solution.
>
>> The common solution is that Tab replaces the selection when it's within a
>> single line, and indents when it spans over multiple lines.
>
> Not sure, it seems just as likely to want to select entire multi-line
> expressions and wnat to replace them iwth new expressions, starting
> with a Tabular indentation...

You can always use Delete or Backspace to delete the selection.

Levente

>
>> I think that's what we should implement as well.
>> Shift+Tab is fine to unindent in all cases, because we don't expect
>> replacement for that key combination.
>
> Agree there, if only the key worked...
>
>

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-3
>> Not sure, it seems just as likely to want to select entire multi-line
>> expressions and wnat to replace them iwth new expressions, starting
>> with a Tabular indentation...
>
>
> You can always use Delete or Backspace to delete the selection.

So could Eliot when he wanted to replace interior text with a Tab.

Instead, the Indentation command has been made _very_ obscure, because
Eliots condition seems exactly reverse of what it should be.   When I
use indentation, I do a sloppy-swipe (middle to middle) of the lines I
want to indent and press Tab.  That's a fair response because no one
ever puts Tab characters in the middle of a word of a line.  However,
people DO want to type tabs _between_ words, or at the _beginning_ of
lines.

Eliot, I'm quite curious about your use-case, are you doing a
text-based report with columns?  If we flipped around your condition
would it still work for you?

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Eliot Miranda-2


On Wed, Nov 18, 2015 at 3:54 PM, Chris Muller <[hidden email]> wrote:
>> Not sure, it seems just as likely to want to select entire multi-line
>> expressions and wnat to replace them iwth new expressions, starting
>> with a Tabular indentation...
>
>
> You can always use Delete or Backspace to delete the selection.

So could Eliot when he wanted to replace interior text with a Tab.

Instead, the Indentation command has been made _very_ obscure, because
Eliots condition seems exactly reverse of what it should be.   When I
use indentation, I do a sloppy-swipe (middle to middle) of the lines I
want to indent and press Tab.  That's a fair response because no one
ever puts Tab characters in the middle of a word of a line.  However,
people DO want to type tabs _between_ words, or at the _beginning_ of
lines.

Eliot, I'm quite curious about your use-case, are you doing a
text-based report with columns? 

Formatting case statements.
 
If we flipped around your condition
would it still work for you?

No it wouldn't.  If I type a tab to replace the selection I mean to replace the selection with a tab.  How else is one supposed to get a tab into the middle of a line, select,copy,paste?? 


Look, my change makes typing a tab in the middle of a line do what one would expect, insert a tab.  It /does not/ prevent anyone from defining Ctrl-tab or Shift-tab to indent our outdent if they want that.  But _one should be able to easily type a tab in the middle of a line with a text editor_, period.

_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-4
Eliot, no worries, from my initial reply in this thread, I've agreed
with you that typing a Tab should insert a Tab character.  That's why
I wanted to move the indent function "out of the way", by requiring a
modifier key.  The problem with that is platform support.  "Sensor
kbdTest" reveals no sensitivity to Shift+Tab in Linux nor to
Control+Tab in Windows.  At the moment, yours is the only solution we
have.

I agree about typing tab characters, I even want to type a tab
character at the time which has now been filtered out.  Indentation is
popping up and surprising me, its still too intrusive.

I want to find the best solution which balances our expectations of
when a tab character should be typed with keeping the Indentation
function as accessible as it can be.  IMHO, we have not yet found that
best optimal balance yet.




> Look, my change makes typing a tab in the middle of a line do what one would
> expect, insert a tab.  It /does not/ prevent anyone from defining Ctrl-tab
> or Shift-tab to indent our outdent if they want that.  But _one should be
> able to easily type a tab in the middle of a line with a text editor_,
> period.

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

marcel.taeumel
... I would rather use Control+Tab for a system windows cycling mechanism ... ;-)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

marcel.taeumel
In reply to this post by Chris Muller-4
I like using TAB or SHIFT+TAB for indent resp. outdent. However, we have to get the selection right. We have to watch for the current context (surrounding whitespaces, beginning of the line etc.).

If we cannot solve it, we should go back to CMD+SHIFT+L/R.

Best,
Marcel

P.S.: Really, ALT+TAB or CMD+TAB or CTRL+TAB is meant to be used for application/window cycling ... don't override this... :)
Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Chris Muller-3
On Thu, Nov 19, 2015 at 1:42 AM, marcel.taeumel <[hidden email]> wrote:
> I like using TAB or SHIFT+TAB for indent resp. outdent. However, we have to
> get the selection right. We have to watch for the current context
> (surrounding whitespaces, beginning of the line etc.).

After sleeping on it, I think Levente has the best idea -- that's
really what its about, indenting _multiple_ lines, otherwise, for
single line I can always just use Tab character.  Eliot said he was
editing case statements, so that would work for that too.

> If we cannot solve it, we should go back to CMD+SHIFT+L/R.

I hope we won't need to, but if we did I would prefer to pick
different keys because L and R are very useful for global keys
(especially R).

> P.S.: Really, ALT+TAB or CMD+TAB or CTRL+TAB is meant to be used for
> application/window cycling ... don't override this... :)

OS's hook Alt+Tab, not Control+Tab, right?  Apps like Google Chrome
hooks Control+Tab.  Squeak is just another app that should be able to
hook Control+Tab too..

Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

marcel.taeumel
>> P.S.: Really, ALT+TAB or CMD+TAB or CTRL+TAB is meant to be used for
>> application/window cycling ... don't override this... :)

> OS's hook Alt+Tab, not Control+Tab, right?  Apps like Google Chrome
> hooks Control+Tab.  Squeak is just another app that should be able to
> hook Control+Tab too..

Absolutely! But not for text editing, but system window cycling. :)

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

marcel.taeumel
Btw, I improved Eliot's approach a little bit more:
http://forum.world.st/The-Trunk-Morphic-mt-1047-mcz-td4861883.html

Still, we seem to be unsure whether we want to keept behavior...?

Best,
Marcel
Reply | Threaded
Open this post in threaded view
|

Re: Fixing tab behaviour and browser hierarchy appearance

Ken G. Brown
In reply to this post by Chris Muller-3

> On Nov 19, 2015, at 09:13, Chris Muller <[hidden email]> wrote:
>
> On Thu, Nov 19, 2015 at 1:42 AM, marcel.taeumel <[hidden email]> wrote:
>> I like using TAB or SHIFT+TAB for indent resp. outdent. However, we have to
>> get the selection right. We have to watch for the current context
>> (surrounding whitespaces, beginning of the line etc.).
>
> After sleeping on it, I think Levente has the best idea -- that's
> really what its about, indenting _multiple_ lines, otherwise, for
> single line I can always just use Tab character.  Eliot said he was
> editing case statements, so that would work for that too.
>
>> If we cannot solve it, we should go back to CMD+SHIFT+L/R.
>
> I hope we won't need to, but if we did I would prefer to pick
> different keys because L and R are very useful for global keys
> (especially R).
>
>> P.S.: Really, ALT+TAB or CMD+TAB or CTRL+TAB is meant to be used for
>> application/window cycling ... don't override this... :)
>
> OS's hook Alt+Tab, not Control+Tab, right?  Apps like Google Chrome
> hooks Control+Tab.  Squeak is just another app that should be able to
> hook Control+Tab too..
>

How about using what the popular Mac editor, BBEdit uses, cmd-[ for move left and cmd-] for move right.
Works the same for single and multiple lines.

Ken G. Brown


12