Home > Coding Helpers > Coding Helpers – Smart Enter

Coding Helpers – Smart Enter

October 12th, 2010

Smart Enter is intended to improve the usability of the Enter key while coding in the editor. If the feature is enabled and the Enter key is pressed, it moves the editor text caret to the next code line (starting it with the same amount of white space on the current line and adding a line statement terminator to the end of the current line if it doesn’t exist (.e.g semi-colon in CSharp) or inside of a code block, leaving the characters to the right of the source caret location at their initial position. It is activated if the character to the right of the current caret position is one of the following:

  • ] (closing bracket)
  • ) (closing paren)
  • > (closing angle bracket)
  • ; (semi-colon)

Here are the CSharp samples where Smart Enter feature may be useful:

1) Before Enter is pressed:

CodeRush Smart Enter test

After Enter is pressed (notice the caret is moved inside of a code block):

CodeRush Smart Enter test

2) Before Enter is pressed:

CodeRush Smart Enter test

After Enter is pressed (notice the caret is moved to the next line, and a semi-colon is added to the end of the staring line):

CodeRush Smart Enter test

The feature doesn’t depend on the current language used and should work everywhere when it is available. The most preferred language for this feature is CSharp, however. By default, it is disabled. To enable it, follow these steps to get to the Smart Enter options page:

  1. From the DevExpress menu, select “Options…” to open the Options Dialog.
  2. In the tree view on the left, navigate to this folder: “Editor\Auto Complete”.
  3. Select the “Smart Enter” options page.
  4. Check the “Enabled” checkbox.

There are no other options on this options page.

—–
Products: CodeRush Pro
Versions: 10.1 and up
VS IDEs: any
Updated: Oct/12/2010
ID: C031

Similar Posts: