5
$\begingroup$

I often preemptively match delimiters. As a simple example, I'll type Import[], then left arrow, then "filename".

The problem is that when I type the ] in Import[], the [ highlights in the normal selection color to signify that this pair of brackets matches. During this automatic highlighting, if I type something that involves the shift key (such as something starting with "), the ] is deleted, leaving Import[". This behavior is as if the ] was selected when the " was typed, but it was not.

To reiterate, the sequence of keys is (quickly typed!) Import[] then Left Arrow and Shift+' but the behavior is as if the sequence were Import[] and then Shift+Left Arrow and then Shift+'.

It might be my imagination, but it seems to have gotten worse in Mathematica version 9.

Can I disable or shorten the automatic highlighting of matching delimiters? It appears to be the source of the phantom shift keystroke.

This is Mathematica version 9 on Mac OS X 10.7.5.


Wolfram support suggested unchecking "Enable dynamic highlighting" and this does not fix the problem. I recorded the problem happening twice in a row here. It happens a bit faster than it is being displayed here.

enter image description here

I'd settle for just shortening the duration of this highlighting so I'd have to be Superman to reproduce the problem.

$\endgroup$
4
  • 1
    $\begingroup$ I can reproduce the problem, but it requires some extremely quick typing! I can't actually type " fast enough, but I can type other Shift combinations. Did you report this as a bug? $\endgroup$
    – Szabolcs
    Dec 17, 2012 at 22:16
  • 2
    $\begingroup$ You should add your operating system, because here on Linux, I cannot reproduce it. One possible quick fix is to to type Import and then Alt+] which creates [] and positions the cursor inside the brackets. $\endgroup$
    – halirutan
    Dec 18, 2012 at 13:44
  • $\begingroup$ @Szabolcs, thank you for reproducing it. I contacted support today. $\endgroup$ Dec 18, 2012 at 16:34
  • $\begingroup$ @halirutan, thanks for the suggestion. On the Mac this is cmd+alt+], which is not nearly as easy. Maybe I'll change the shortcut to alt+] and use this as the workaround. $\endgroup$ Dec 18, 2012 at 16:36

1 Answer 1

2
$\begingroup$

The delimiter highlighting time is controlled by the option DelimiterFlashTime, which can be set for a cell or a notebook or the entire front end. You can lower the value (default 0.3 seconds) or disable it entirely with a value 0.

SetOptions[EvaluationNotebook[], DelimiterFlashTime -> 0]

Change to $FrontEndSession if you want to change it across all notebooks for the current session or use $FrontEnd if you want to change it for the entire front end from here onwards.

$\endgroup$
2
  • $\begingroup$ ConstantArray["thank you",Infinity] $\endgroup$ Dec 29, 2012 at 16:39
  • $\begingroup$ You're welcome :) $\endgroup$
    – rm -rf
    Dec 29, 2012 at 17:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.