Sublime Forum

Syntax Highlight Current Scope Only

#1

Is it possible to apply syntax highlighting to the enclosing scope for the current line only, keeping the rest muted or monochrome?

001 if ($scope.phase === 'ADDDESCRIPTION') { 002 if (!$scope.ad.classifiedData.Common.Title || ($scope.ad.classifiedData.Common.Title.length < 4)) { 003 $scope.generalAlerts.push({ 004 type: 'danger', 005 msg: 'You must enter a Title of between 4 and 80 characters' 006 }); 007 008 errorCount +=1 ; 009 } 010 }

For instance in the snippet above, if the cursor is on line 004, syntax highlighting extends from 003 - 006.

If the cursor is moved down to line 008, highlighting extends from 002 - 009; up to 001, and 001 - 010 are covered.

I quite often find I want to concentrate on a small section of code, but see it in a wider context. This would help to retain focus as I move to the specific section.

0 Likes

#2

This is the sort of thing, but at a finer grained level. Something for me to take a punt at anyway

sublime.wbond.net/packages/Expa … JavaScript

0 Likes

#3

Was there a solution to this? I’m interested in a similar feature.

Thanks!

0 Likes