Indent does not work on last selected line

SyntaxEditor for WPF Forum

Posted 4 years ago by Xinen Lee
Version: 15.1.0622
Platform: .NET 4.5
Environment: Windows 7 (64-bit)
Avatar

When a whole line is selected by clicking on the line number, a Tab should and will indent the whole line, as the caret is on the next line's position 0.

However when the whole last line is selected by clicking on the line number, a Tab will replace the line with a tabstop instead of indenting the whole line. This is unexpected and inconsistent.

Comments (3)

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

Hello,

Thanks for reporting this.  We'll update it for the next maintenance release.


Actipro Software Support

Posted 4 years ago by Erwin Liong
Avatar

With Build 624, the last line indentation works when the line is selected from side margin (clicking on the line number). 

However, it introduces a different inconsistency. When the line is selected manually (via Home, Shift+End), pressing Tab key should replace the selected text with '\t'. Instead, it added a Tab stop at the beginning of the text. This is inconsistent when the same action is performed on a non-last line.

Expected Behaviors for single line:

  • Manual selection of text (partial or full line), the selected text should be replaced with '\t'.
  • Text selection via side margin, a Tab Stop should be added at the beginning of the line (aka Indented).

Please fix this. Thank you.

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

Hi Erwin,

There is no good solution for this scenario since a selection is a selection regardless of how it was created.  The last line of a document is tricky because the caret can't be moved to the next line to trigger a "full-line" selection, as there is no next line in that case.  Thus pressing Tab when the last line's text range is selected needs to do one thing or the other.

It looks like Visual Studio 2015 does exactly what our latest code bits do.  With any start to end selection on the last line, when Tab is pressed, the text is indented. 

We will likely stick with this behavior.  It is a better option since to get the replace with a \t behavior, you could simply press Del and then press Tab.  Whereas if we had it like before, to indent, you would need to collapse the selection (losing the selected text), move to the start of the line, and press Tab.  There point here is that the way it is now (same as VS), there's less overall downside.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.