Author Topic: if<space> confusion with dynamic surround/formatting  (Read 653 times)

astromme

  • Senior Community Member
  • Posts: 155
  • Hero Points: 1
if<space> confusion with dynamic surround/formatting
« on: November 02, 2023, 05:57:11 PM »
I type 'i' 'f' <space> and get this:

Code: [Select]
    if() {
       
    }

what I expect is this:
Code: [Select]
    if () {
       
    }

Note the space between the if and the parentheses.

After I press the space, at the bottom it says "Dynamic Surround has been performed.  Search the help for Dynamic Surround for more information."  Searching through that doesn't make things obvious to me.

In Tools->Options->Languages->Application Languages->C/C++->Formatting when I Edit... My Default, under Spacing->Statements->if things look correct.  Before opening parenthesis is ON.

Under Aliases for "if":
Code: [Select]
if (%\c) {
%\m sur_text -indent%
}

"Auto-Surround" is enabled for all choices.

I don't understand.  What am I missing here?