Can we make Shift+Tab work as Unindent [outdent] no matter where the cursor is?

SyntaxEditor for Windows Forms Forum

Posted 10 years ago by Michael Dempsey - Sr. Developer, Teradata Corp
Version: 14.1.0320
Avatar

My users frequently use Shift+Tab to unindent [Outdent] code.

We have found that it only works so long as the cursor is not at the left margin.

For example, if the line starts with 4 tabs and the cursor is after the first tab they are only able to use Shift+Tab once.
After that it has no effect.

They want to be able to use it 4 times in this case - to bring the text to the left margin.

Other editors [including the one I used to use in my product] ignore the position of the cursor and allow all 'prefix' tabs to be removed no matter where the cursor is positioned.

Thanks
Mike 

Comments (4)

Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

I tried this in the latest version but it seems to be working how you wanted from what I can tell.  Are you using the latest build and if so, can you tell me exact steps to repro it in the SDI Editor demo?  Thanks!


Actipro Software Support

Posted 10 years ago by Michael Dempsey - Sr. Developer, Teradata Corp
Avatar

Place the cursor on line 29, which is indented 3 tabs.

Put it 1 tab from the left margin.

Press Shift+Tab - it outdents one tab (bringing the cursor to the left margin)

Press Shift+Tab agian - nothing happens.

Once the cursor has been moved to the left margin Shift+Tab no longer does anything.

Answer - Posted 10 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Mike,

Ah, I see what you mean now.  I had been doing similar but I had the selection extend from the first tab to the start of the next line (so that a line terminator is encompassed).  If you do that, it will work as you wanted.

I tested the same scenario you pointed out in VS 2013 and it works how ours does, which makes sense since we modeled SyntaxEditor mostly after the VS code editor behaviors.  The logic is such that if you have a collapsed selection, it will only outdent if you have a whitespace character before.  On the other hand, if you have a selection that spans the line terminator, it will force a block outdent.

All that being said, we like the suggestion and will add it for the next maintenance release.


Actipro Software Support

Posted 10 years ago by Michael Dempsey - Sr. Developer, Teradata Corp
Avatar

Great. Thanks.

The latest build of this product (v24.1.0) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.