Hello there,
I've found a bug while I was thinking about requesting a feature. So what's the bug? Steps to reproduce: 1. Make sure you have a pair of curly brackets in a file 2. Make sure only one of them is visible and the other is hidden (ie you've scrolled so much down the document that the starting bracket is not visible) 3. Position your cursor before the curly bracket and then move the cursor after the bracket. You will see how the whole editing area flashes
While I'm at this may I ask if it's possible to highlight the matching bracket if your cursor is either before/after a curly bracket because currently I have to go back then forwards to see the matching bracket. I've also attached a testcase file which you can use to check if you can reproduce this bug.
Regards, Milen
PS. This also happens in Xcode.
On Jun 13, 2006, at 1:40 PM, Milen Dzhumerov wrote:
Hello there,
I've found a bug while I was thinking about requesting a feature. So what's the bug? Steps to reproduce:
- Make sure you have a pair of curly brackets in a file
- Make sure only one of them is visible and the other is hidden
(ie you've scrolled so much down the document that the starting bracket is not visible) 3. Position your cursor before the curly bracket and then move the cursor after the bracket. You will see how the whole editing area flashes
I think that's supposed to happen (to let you know the match is off screen), but I could be wrong.
While I'm at this may I ask if it's possible to highlight the matching bracket if your cursor is either before/after a curly bracket because currently I have to go back then forwards to see the matching bracket.
More important than seeing the matching brackets to me is being able to navigate to them (either direction). Is this possible or planned?
Rob
Milen wrote:
While I'm at this may I ask if it's possible to highlight the matching bracket if your cursor is either before/after a curly bracket because currently I have to go back then forwards to see the matching bracket.
There's a helpful "Edit => Select => Enclosing Brackets" command that can be useful in this sort of situation. (Well, if you're *inside* a bracketed section.)
On a bit of a tangent... Armed with the above command you can invent "Go to start of bracketed chunk/Go to end of bracketed chunk" commands that also work if you're to the left of the bracket. For example, if you want the cursor to end up to the left of the closing bracket.
Start Macro Recording Arrow right Edit => Select => Enclosing Brackets (or command-shift-b) Arrow right Arrow left Stop Macro Recording Save Scratch Macro (as, say, "brackdown")
[In case it's not clear: the first arrow right takes you inside the starting bracket in the case where you're just to the left of it.]
Maybe save with something like control-option-d. Do the opposite thing for selecting the opening bracket;
Start Macro Recording Arrow left Edit => Select => Enclosing Brackets (or command-shift-b) Arrow left Arrow right Stop Macro Recording Save Scratch Macro (as, say, "brackup", key equiv control-option-u)
Adjust as necessary... Obviously it's a bit of a hack (and I'll not be the slightest bit shocked if someone points out a built-in way to do this), but it pretty much does what's advertised unless your bracket pair is {}. But in that case I have great faith that you can find the matching pair! Anyway, sorry if this whole post has little to do with your original question...
Cheers, Paul
On 14.06.2006, at 01:32, Paul McCann wrote:
Milen wrote:
While I'm at this may I ask if it's possible to highlight the matching bracket if your cursor is either before/after a curly bracket because currently I have to go back then forwards to see the matching bracket.
There's a helpful "Edit => Select => Enclosing Brackets" command that can be useful in this sort of situation. (Well, if you're *inside* a bracketed section.)
On a bit of a tangent... Armed with the above command you can invent "Go to start of bracketed chunk/Go to end of bracketed chunk" commands that also work if you're to the left of the bracket. For example, if you want the cursor to end up to the left of the closing bracket.
There even is a “Navigation” Bundle (in the svn) which seems to do exactly that.
Soryu.