5

SyntaxHighlighter has a feature that allows code selection by double clicking. How can I disable this feature?

Mas
  • 4,546
  • 5
  • 39
  • 56
Ryan
  • 2,825
  • 9
  • 36
  • 58

2 Answers2

6

You need to set the quick-code setting to false.

// Disable double click feature
SyntaxHighlighter.defaults['quick-code'] = false;

// Initialize SyntaxHighlighter
SyntaxHighlighter.all();

Tested on version 3.0.83.

Mas
  • 4,546
  • 5
  • 39
  • 56
0

Here are the relevant lines in the source code. I'm still confused about how the default key is quick-code but the setting that's referenced is quickCode. I'm thinking it's something to do with his use of opts-parser https://github.com/syntaxhighlighter/opts-parser.

https://github.com/syntaxhighlighter/syntaxhighlighter/blob/b35cee8468e87eaac6e303f0115c02626d1bef0f/src/defaults.js#L33

https://github.com/syntaxhighlighter/syntaxhighlighter/blob/b35cee8468e87eaac6e303f0115c02626d1bef0f/src/core.js#L152

Andrew
  • 3,733
  • 1
  • 35
  • 36