Not able to delete one space character with 'Backspace' key on the keyboard

SyntaxEditor for WPF Forum

Posted 8 years ago by James Zheng
Version: 16.1.0631
Platform: .NET 4.5
Environment: Windows 7 (64-bit)
Avatar

Hi Actipro,

1. Navigate to '\\SyntaxEditor - Demos\Python Editor (Python Lang. Add-on)'

2. Remove all the text in the editor

3. Press the 'Space' key on the keyboard 4 times, so that 4 spaces are entered.

4. Press the 'Backspace' key on the keyboard once.

5. Observe all the spaces are removed.

Expected result:

It's expected that only one space is removed, not 4 spaces. After some investigation, this issue is related to

AutoConvertTabsToSpaces setting. This behavior is different from visual studio when converting tab to spaces setting is enabled.

Regards,

James Zheng

[Modified 8 years ago]

Comments (7)

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

Hi James,

This feature (Backspace before the first non-whitespace character on a line moving to the previous tab stop when spaces indent) is actually by design and was specifically requested by a customer who was heavily involved in the design of the Python Language Add-on.  At the time, they said that Canopy, Visual Studio, and PyCharm all did that same thing.  It could be that Visual Studio 2015 changed Backspace again, but looking at apps like Sublime Text, they also have this feature.

You can always use left arrow and then Delete to accomplish what you are trying to do when AutoConvertTabsToSpaces is true.


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

Understand that this is a feature request for editing performance. I tried it on VS2012, it's not as what they claimed. Anyway, using

AutoConvertTabsToSpaces to convert backspaces to a tab is a surprise to other users like ours. I would like to request a seperate flag for this.

FYI. Visual studio uses Ctrl + 'Backspace' key for this.

I like the idea of using Ctrl + 'Backspace' key for removing all the leading spaces in our Actipro editor. :)

Thanks and Regards,

James Zheng

[Modified 8 years ago]

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

Hi James,

I believe we already support Ctrl+Backspace like VS does.  The reason for the Backspace feature was that if you have AutoConvertTabsToSpaces on and press Tab, you get 4 spaces inserted (or enough spaces to get to the next tab stop).  Pressing Backspace once allows you to remove the spaces back to the previous tab stop.  This can be handy, especially when you are several tab stops deep in indentation and don't want to Ctrl+Backspace to the line start.  It also means you don't have to press Backspace 4 times to outdent to the previous tab stop.  And again, this only happens to spaces before the first non-whitespace character on the line.

Before we do anything, can you tell us the scenario where this functionality causes problems?  Perhaps give us a step-by-step example showing why you don't like it so we can better understand the usage scenario.  Thanks!


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

This is mainly to satisfy our existing users, as we are in the process of replacing old editor with Actipro editor.

If users choose to convert tabs into spaces, why would they want the resolution of a tab instead of a space when backspacing, since they prefer working with spaces?

This is contradicting. What do spaces serve here?  Understand that, for web developers, spaces are needed for some files to be interpreted correctly, such as a config file for mongo db (YAML formated). I'm speaking from my users' point of view. Yes, we can always select spaces and delete it. But that requires more steps.

Regards,

James Zheng

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

Hi James,

Ok, any ideas for a SyntaxEditor-based property name that would control this feature?  For instance: CanBackspaceToPreviousTabStop, CanBackspaceSingleIndentationSpace, or something better?


Actipro Software Support

Posted 8 years ago by James Zheng
Avatar

Hi Actipro,

How about 'AutoConvertBackSpacesToBackTabs' ?

Regards,

James Zheng

[Modified 8 years ago]

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

Hi James,

We will add a SyntaxEditor.CanBackspaceOverSpacesToTabStop property (defaulting to true) for the next maintenance release.


Actipro Software Support

The latest build of this product (v24.1.1) 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.