Sublime Forum

ST3 BracketHighlighter Status

#1

I have decided to only port the next release of BracketHighlighter2. I have been able to restore basic bracket highlight functionality, but the there is a lot of broken crap dealing with the Bracket Plugins. Also, it appears that parts of the API are not yet finished which also gives a less than reliable experience in regards to settings being reloaded proper.

Nothing has been committed, and I don’t know yet when it will be because I am going to have to restructure a bunch of crap because of the substantial changes. Removing begin_edit and end_edit really screws up my system…argghh.

ST3 is a pretty big change really messing up how I did things. General highlighting was pretty easy to kick start on ST3…everything else…not so much.

0 Likes

#2

Sigh. There are apparently other things not implemented that are holding me back. I may need to wait until ST3 catches up first. Surprisingly it is not the Python3 upgrade causing me trouble, but the ST3 plugin system changes.

0 Likes

#3

Yeah, it’s kind of weird how you don’t really have access to begin_edit() outside of a command, yet still need to explicitly pass around edit objects.

I’m guessing top level commands (issued by keybinding/palette/menu etc vs api) are the only ones that are of consequence to the undo/repeat/macro system?

If that’s the case, I’m wondering why even need to pass around edit objects, other than that’s the way it was done in ST2?

0 Likes

#4

re: dangling Edit objects, with view.end_edit(edit) not called

Perhaps if the api for non command based edits just took a function to execute immediately you wouldn’t have as many of those problems

re: nested edits

Does any one have much insight into how they worked in ST2?

0 Likes

#5

Yeah, it has really thrown a monkey wrench in this plugin. I have a feeling I will need to rearchitect how I am doing things. Not what I was hoping. It is like you said; it is odd that you have to pass around the edit object, but you can’t create one yourself anymore.

0 Likes

#6

Dunno if you used ST1, but back then there was no explicit edit objects at all

Yeah, I got a fuckbunch of plugins that’ll need “fixing” too :confused:

Hardly any of the edits for those will even make sense to be able to macro/repeat

0 Likes

#7

Seems like just creating a TextCommand and just calling it where you need to edit is sufficient since the run commands seem to be synchronous. Any data you wanted to share though, you usually have to stuff in some global object for sharing. A little annoying, but not a big deal. So I have parts of different bracket plugins working again. Still a bit more shuffling to be done.

Anyone had any issues with changing the selections? It appears that every time my plugin sets the selection, my cursor disappears instead.

0 Likes

#8

Hmm.

Individually adding them as below doesn’t seem to work for me.

view.sel().add(Region)

For some odd reason this does:

view.sel().add_all([Region])

I may take a look into the Sublime layer and see what the deal is…weird. Well that is more functionality restored. BH2 for ST3 is well on its way.

0 Likes

#9

Well, it probably was because I was mapping it. Looks like add_all just calls add anyways. Maybe there is a PY3 issue here. I was actually doing this which used to work:

map(lambda x: self.view.sel().add(x), self.sels)

Not so much anymore…well it add_all is working, I will look into the whys for map later.

0 Likes

#10

BracketHighlighter2 is ported except for wrapping and swapping. This is broken because view.insert stopped returning number of modified characters in ST3 (this is useful because sublime will convert spaces to tabs or vice versa).

I am hoping Jon will bring back the missing functionality. As soon as this is resolved, I will post a ST3 BracketHighlighter2 branch.

0 Likes

#11

Mostly working branch of BH2 for ST3 github.com/facelessuser/Bracket … ree/BH2ST3

Wrapping and swapping are broken for now.

0 Likes

#12

Yeah, map returns an iterator now

0 Likes

#13

Gutter icons in OSX appear to be broken. Haven’t figured out how to get them working yet.

0 Likes

#14

Thank you! 50% of plugins that i can’t live without are now compatible with ST3.

Waiting for emmet :smiley:

0 Likes

#15

FYI icons work on OSX if I first create the “Theme - Default” directory in the Packages path. This obviously wouldn’t exist by default now that sublime-packages don’t need to be unpacked.

0 Likes

#16

Thanks, I figured that might be the case, just hadn’t tried it yet. That may be a good workaround, thanks for letting me know. Ideally Jon will one day will allow us to more directly control the gutter icons, but I am okay with an ugly hack for this right now.

0 Likes

#17

Icons should be working now on all platforms. A restart might be needed. This is only on the latest 3010 build.

Wrapping and Swapping still look to have some bugs, but the recent addition of insert returning characters again by Jon is allowing the features to get closer to how they used to work.

0 Likes