Author Topic: Select the matching brace via double-clicking a brace (SE 14.0.2.2)  (Read 4751 times)

Ding Zhaojie

  • Senior Community Member
  • Posts: 193
  • Hero Points: 37
In SourceInsight, there is a very good feature: while double-clicking a brace, it will select the matching brace automatically. It is very convenient while reading some large code blocks: the selection color could help me focus on the block. So I patched the mouse.e to add this feature. Merge and try, have fun!  ;D
« Last Edit: August 03, 2009, 02:19:56 pm by Ding Zhaojie »

jko

  • Junior Community Member
  • Posts: 2
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #1 on: November 13, 2009, 02:17:25 pm »
404 - Attachment Not Found   ???

Ryan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 986
  • Hero Points: 77
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #2 on: November 13, 2009, 02:41:59 pm »
FYI, looks like this has already been added to version 15...thanks Ding.

- Ryan

hp

  • Community Member
  • Posts: 31
  • Hero Points: 1
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #3 on: November 16, 2009, 09:14:05 am »
You can achieve a similar effect using folding. Either chose menu View->Hide Block or click the "+braces" icon on the selective display toolbar. It will just additionally fold the section inside the braces.

Scott277

  • Community Member
  • Posts: 17
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #4 on: November 16, 2009, 01:56:07 pm »
If you are editing in Vim emulation, the percent sign (%) will do the same thing.

gixxer

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #5 on: August 07, 2018, 08:48:05 pm »
Hello, anyone able to get this feature to work (c/c++)?

I'm on v22.0.2.1 64-bit in Linux, and double click on left brace does nothing, other than selecting that brace char.

Has this feature been removed?

Looking at LDoubleClick key sequence, it's mapped to command mou-select-word, which says it selects the current word with a character type selection.


Thanks much.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #6 on: August 07, 2018, 09:04:25 pm »
Hello, anyone able to get this feature to work (c/c++)?

I'm on v22.0.2.1 64-bit in Linux, and double click on left brace does nothing, other than selecting that brace char.

Has this feature been removed?

Looking at LDoubleClick key sequence, it's mapped to command mou-select-word, which says it selects the current word with a character type selection.


Thanks much.

Double click in SlickEdit has never supported brace/block matching. The default binding is Ctrl+] (find-matching-paren is the commad name).

gixxer

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #7 on: August 07, 2018, 09:17:23 pm »
Thanks.

Perhaps closet would be following command,

select-code-block

gixxer

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #8 on: August 07, 2018, 09:27:10 pm »
Strange enough, Ding's diff is still in latest SE's mouse.e file.

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #9 on: August 07, 2018, 09:43:26 pm »
Hmm...I was totally wrong ;D I'm double clicking on a brace (open paren or brace or bracket) and the block is selected. I'm testing a default config though.

Not sure what changes in configuration would affect this other than mouse bindings.

gixxer

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #10 on: August 07, 2018, 09:51:11 pm »
In offline e-mail conversation, i was told to try select-matching-brace command.  That command alone does the job.

Then i tied that command to LDoubleClick key sequence, bind to C/C++.

But double click on left brace, for instance does not yield the same result.

Is that becuase there is also mou-select-word mapped to LDoubleClick with "default" Mode?


gixxer

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #11 on: August 07, 2018, 09:56:38 pm »
I got it to work by removing the mou-select-word from LDoubleClick map.

So, i have to choose between mou-select-word and select-matching-brace to map to LDoubleClick map?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #12 on: August 07, 2018, 10:00:13 pm »
Yes

mou-select-word seems much better.

gixxer

  • Community Member
  • Posts: 10
  • Hero Points: 0
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #13 on: August 07, 2018, 10:06:59 pm »
Yes

mou-select-word seems much better.
What do you mean?

Clark

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 4893
  • Hero Points: 398
Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
« Reply #14 on: August 07, 2018, 10:11:47 pm »
From what I can tell mou-select-word is a superset (feature set wise) of select_matching_brace which was never intended to be bound as a mouse event.

For example, mou-select-word supports selecting a brace block, selecting a word, or selecting multiple words (double click and drag).