SlickEdit Community

SlickEdit Product Discussion => SlickEdit® => Topic started by: Ding Zhaojie on August 03, 2009, 01:56:37 pm

Title: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Ding Zhaojie on August 03, 2009, 01:56:37 pm
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
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: jko on November 13, 2009, 02:17:25 pm
404 - Attachment Not Found   ???
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Ryan on November 13, 2009, 02:41:59 pm
FYI, looks like this has already been added to version 15...thanks Ding.

- Ryan
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: hp 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.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Scott277 on November 16, 2009, 01:56:07 pm
If you are editing in Vim emulation, the percent sign (%) will do the same thing.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer 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.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Clark 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).
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer on August 07, 2018, 09:17:23 pm
Thanks.

Perhaps closet would be following command,

select-code-block
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer on August 07, 2018, 09:27:10 pm
Strange enough, Ding's diff is still in latest SE's mouse.e file.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Clark 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.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer 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?

Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer 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?
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Clark on August 07, 2018, 10:00:13 pm
Yes

mou-select-word seems much better.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer on August 07, 2018, 10:06:59 pm
Yes

mou-select-word seems much better.
What do you mean?
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Clark 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).
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer on August 07, 2018, 10:15:57 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).

That works for me.

But what am i doing wrong with mou-select-word? 

In c/c++, mou-select-word does nothing either double-click or mou-select-word as command, like select-matching-brace.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: Clark on August 07, 2018, 10:21:34 pm
The "mou-" commands are typically intended only to be invoked by mouse events.

Likewise, commands that don't have "mou-" should typically never be bound to a mouse event.

We haven't enforced this restriction. This has confused users. You're not the only one.
Title: Re: Select the matching brace via double-clicking a brace (SE 14.0.2.2)
Post by: gixxer on August 07, 2018, 10:26:28 pm
Ok, thanks.

I'm not looking to create any new precedence.  I'm okay working within the guidelines.

But can you help with how to get mou-select-word to do selecting of brace block?

How do i accomplish this?  I've reset to default configuration for testing sake.