Home Download Buy Blog Forum Support

ST3: BracketHighlighter 2

Re: ST3: BracketHighlighter 2

Postby lewisl on Wed Mar 13, 2013 3:23 am

In st2, I highlight matching braces with a light yellow background. As I cursor around I can always see what's in scope. In st2, the default outline approach conflicts with linter and the underlines weren't very visible.

I suppose I could get used to it because now you use a very heavy underscore.

Reason for yellow background is for seeing matching brackets with many levels of nesting on a single line (the fold column bracket chars don't help on a single line).

so, that's what I want. It's ok if not possible.
lewisl
 
Posts: 26
Joined: Thu May 10, 2012 5:52 am

Re: ST3: BracketHighlighter 2

Postby facelessuser on Wed Mar 13, 2013 3:56 am

You can use any style you like. The underscore is the default style but you can change the style of any bracket you want individually.

You can use the following: solid, underline, thin_underline, outline, squiggly, stippled, or none. solid will give you the background of the bracket colored.

Do something like this to make square brackets solid. Go under the "bracket_style" setting and find the bracket you want to change and set the style to solid:
        "square": {
"icon": "square_bracket",
"color": "brackethighlighter.square",
"style": "solid"
},


You can do anything in BracketHighlighter 2 that you could do in BracketHighlighter 1.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: BracketHighlighter 2

Postby lewisl on Thu Mar 21, 2013 5:07 pm

Awesome. Thanks.
lewisl
 
Posts: 26
Joined: Thu May 10, 2012 5:52 am

Re: ST3: BracketHighlighter 2

Postby rcrooks on Thu Mar 21, 2013 8:42 pm

fwiw, I haven't been able to get this to work in ST3 either, despite multiple attempts.
Here's what I get in the console:
ImportError: No module named 'BracketHighlighter'
reloading plugin BracketHighlighter.BracketHighlighter
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 72, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1505, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1522, in _find_and_load_unlocked
ImportError: No module named 'BracketHighlighter'
reloading plugin BracketHighlighter.Elements
Traceback (most recent call last):
File "/Applications/Sublime Text.app/Contents/MacOS/sublime_plugin.py", line 72, in reload_plugin
m = importlib.import_module(modulename)
File "X/importlib/__init__.py", line 88, in import_module
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1505, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 313, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 1577, in _gcd_import
File "<frozen importlib._bootstrap>", line 1558, in _find_and_load
File "<frozen importlib._bootstrap>", line 1522, in _find_and_load_unlocked
ImportError: No module named 'BracketHighlighter'
rcrooks
 
Posts: 6
Joined: Sun Feb 10, 2013 9:24 pm

Re: ST3: BracketHighlighter 2

Postby skuroda on Thu Mar 21, 2013 8:45 pm

You are using BH not BH2. Remove that package. Assuming you are using package control, add the following as a repository (https://github.com/facelessuser/Bracket ... ree/BH2ST3) and reinstall BracketHighlighter. If not, ensure you are using the BH2ST3 branch of BH.
skuroda
 
Posts: 677
Joined: Fri Oct 05, 2012 8:11 am

Re: ST3: BracketHighlighter 2

Postby facelessuser on Sat Mar 23, 2013 11:48 pm

BH2 is now the master branch. BH1 is dead; long live BH2.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: BracketHighlighter 2

Postby brnorman on Mon Mar 25, 2013 9:05 pm

I have BH2 installed with ST3 and I like the look of the bracket highlighting but I'm having issues with the matching accuracy on my php file. Specifically when I load the file with Notepad++ and go through all of the Divs they match perfectly but with BH2 most of them don't match the correct opening or closing div markers. Any ideas?
brnorman
 
Posts: 4
Joined: Mon Mar 25, 2013 8:57 pm

Re: ST3: BracketHighlighter 2

Postby facelessuser on Mon Mar 25, 2013 9:37 pm

If you are talking about stray <div> tags under a PHP if else statement, then yes, BH is going to have a hard time with that. BH also has a hard time with similar things with compiler switches in C/C++ when people do wacky #if statements. This is a problem, because of 1. how BH tackles matching brackets and 2. the unpredictable places you can put the PHP if statements in the middle of HTML. If I added a whole lot more complexity, I could catch such things, but I don't plan on doing that.

Of course, I have no idea if your problem is because of what I described above. Please post an example and explain the issue you are having so I can properly evaluate whether it is something I can and want to fix.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3: BracketHighlighter 2

Postby brnorman on Mon Mar 25, 2013 10:45 pm

facelessuser wrote:If you are talking about stray <div> tags under a PHP if else statement, then yes, BH is going to have a hard time with that. BH also has a hard time with similar things with compiler switches in C/C++ when people do wacky #if statements. This is a problem, because of 1. how BH tackles matching brackets and 2. the unpredictable places you can put the PHP if statements in the middle of HTML. If I added a whole lot more complexity, I could catch such things, but I don't plan on doing that.

Of course, I have no idea if your problem is because of what I described above. Please post an example and explain the issue you are having so I can properly evaluate whether it is something I can and want to fix.

-----------------------------------------------
Fair enough. I don't think that is the case here and I'm happy to post example. Not sure best way to do that so I'm pasting the whole page here (if you want something else let me know). THANKS!

<?php
if (isset($_FILES['imgselect'])) {

if (preg_match('/[.](jpg)|(gif)|(png)$/', $_FILES['fupload']['name'])) {

$filename = $_FILES['fupload']['name'];
$source = $_FILES['fupload']['tmp_name'];
$target = $path_to_image_directory . $filename;
echo "You selected: " . $filename;
// move_uploaded_file($source, $target);
// createThumbnail($filename);
}
}

?>
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">

<!-- Place favicon.ico and apple-touch-icon.png in the root directory -->

<link rel="stylesheet" href="css/reset.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="http://code.jquery.com/ui/1.10.1/themes/base/jquery-ui.css" />
<script src="myscript.js"></script>
<script src="js/vendor/modernizr-2.6.2.min.js"></script>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://code.jquery.com/ui/1.10.1/jquery-ui.js"></script>
<script>
$(function() {
$( "#datepicker" ).datepicker({ dateFormat: 'yy-mm-dd' }).val();
});
</script>
</head>

<body>


<div id="all">
<div id="content">
<h1>Artist's Inventory</h1>
<div id="floatcontain">
<?php
include('topmenu.html');
?>

<div id="center">

<!-- Add your site or application content here -->

<form name="additem" action="commit_itemdata.php" onsubmit="return validateForm();" method="post">
<!-- <label>Inventory ID:</label> <input class="inp" type="text" name="inventoryid" id="inventoryid" value="To Be Assigned"><br> -->
<label>Title:</label> <input class="inp" type="text" name="title" ><br>
<label>Medium:</label> <input class="inp" type="text" name="medium" ><br>
<label>Subject:</label> <input class="inp" type="text" name="subject" ><br>
<label>Created: </label> <input class="inp" type="text" id='datepicker' name="created_date"><br>
<label>Dimensions: </label> <input class="inp" type="text" name="dimensions" ><br>
<label>Sale Price:</label><input class="inp" type="text" name="sellingprice" ><br>
<label>Description:</label><input class="inp" type="text" name="description" id="description" ><br>
<!-- <label>Location:</label><input class="inp" type="text" name="location" id="location" ><br> -->


<?php

error_reporting(E_ERROR | E_WARNING | E_PARSE | E_NOTICE);
require_once('dbconfig.php');

$query = "select idlocation, location_name from location";


// echo "<br />".$allquery;
$result = mysqli_query($link, $query) or die('Unable to run query:' . mysql_error());

//$Pieces = mysqli_num_rows($result);
// echo " (Number of Pieces: $Pieces)</h1>";

if (!$result) {
echo "bad result";
echo mysql_errno($link) . ": " . mysql_error($link) . "\n";
}
echo "<select class='inp' name='location'>";
while ($row = mysqli_fetch_assoc($result)) {
echo "<option value=\"{$row['idlocation']}\">{$row['location_name']}</option>";
}
echo "</select>";

?>


<label>Venue:</label>
<input type="button" value="Add Venue" class="button_menu" onclick="addloc();"/> <br>
<label>Notes:</label> <textarea class="inp" rows="8" cols="40" name="notes" id="notes"></textarea><br>


</div> <!-- end div center -->
<div id="right">
<h2>Image File:</h2>
<div id="FileUpload">

<input type="file" id="BrowserHidden" name="image_file" onchange="getElementById('FileField').value = getElementById('BrowserHidden').value;" />

<div id="BrowserVisible"><input type="text" id="FileField" /></div>
</div> <!-- end div FileUplad -->

<!-- <input type="submit" value="SUBMIT" /> -->
<input type="button" value="Submit" class="button_menu sbtn" onclick="vsubmit();"/>
</form> <br>




</div> <!-- end div right -->
<div id="footer">
Bruce Norman 2013
</div>
</div> <!-- end div floatcontain -->
</div> <!-- end div content -->
</div> <!-- end div all -->

</body>
</html>
brnorman
 
Posts: 4
Joined: Mon Mar 25, 2013 8:57 pm

Re: ST3: BracketHighlighter 2

Postby facelessuser on Mon Mar 25, 2013 11:07 pm

Edit: see my next post
Last edited by facelessuser on Mon Mar 25, 2013 11:25 pm, edited 1 time in total.
facelessuser
 
Posts: 1570
Joined: Tue Apr 05, 2011 7:38 pm

PreviousNext

Return to Plugin Announcements

Who is online

Users browsing this forum: No registered users and 13 guests