Author Topic: Surround Selection on  (Read 2278 times)

Offline Arthur

  • Registered User
  • Hero Member
  • *
  • Posts: 653
  • Karma: +1/-0
  • He who is ashamed of asking is afraid of learning.
    • View Profile
    • My Blog
Surround Selection on
« on: August 28, 2009, 02:50:17 pm »
The setting to surround selection on " - can it be separated from others?
Or better yet to have them all separated for better/fine tuning?
I really find it useful to have ( or { or [ surrounded but find most often the " is not helping rather being annoying (e.g. when I need to modify exiting strings it introduces inadvertently at times an extra " which leads to compile time errors if I am not vigilant enough).

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2184
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Surround Selection on
« Reply #1 on: August 28, 2009, 03:17:15 pm »
Hello Arthur,

you can achieve this by changing:
Code: [Select]
<OpenClose>()[]{}""</OpenClose>

in corresponding spec file. Just remove "" and you are done (I assume you need to do this in basic_spec.xml).
But do not forget, that you are changing one of default schemes that can be overwritten.

Best regards,
Alex.

Offline Stefan

  • Administrator
  • Hero Member
  • *****
  • Posts: 775
  • Karma: +6/-0
    • View Profile
Re: Surround Selection on
« Reply #2 on: October 10, 2009, 09:40:41 pm »
Just to be clear, if someone find this thread:

What Arthur describes disturbing him, is the feature "Auto-Brackets", not "Surround Selection on",
both found at "Tools > Options > Formatting > Smart Helpers".

I think "on" is the wrong word for this feature?
Wouldn't "with" be the better description?
"Surround Selection with Brackets",
(i was fooled too the first times, because i saw all that brackets there and thought "that must be that feature")


But the solution described by Alex is true for both features,
they use both the same source; <OpenClose> tag in <lang>_spec.xml


Explanation:
"Auto-Brackets" insert an closing bracket if an opening bracket is written.
"Surround Selection on" will put brackets on both sides of an selection - if opening bracket is pressed.

Brackets for this issue are defined in <lang>_spec.xml inside of <OpenClose>...</OpenClose> tags,
e.g. : <OpenClose>()[]{}''""</OpenClose>

Offline alex

  • Developer
  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2184
  • Karma: +37/-3
    • View Profile
    • HippoEDIT
Re: Surround Selection on
« Reply #3 on: October 10, 2009, 11:55:39 pm »
Surround selection on / * etc was copied from Visual Assist settings. So not me have invented this ;)
but nevertheless I have changed text to with Surround selection with