Sublime Forum

Best way to deal with highlighting multi-line function definitions

#41

No matter what the order is of the regions when you add them, they will always come back to you sorted to appear in document order from top to bottom (I presume for performance reasons so Sublime can easily determine based on what you can see in the window what regions it might need to draw).

Based on the output you provides, the regions aren’t being added in a top down order; that’s why you get them out in a different order. Region 0 should be line 29 always, region 1 should be line 30 always, etc.

0 Likes

#42

Thanks, I see now. The compiler returns the warnings in that order so that’s what I have to work with. This means I need to sort the warnings by line number correct? Is there a method to override when the build is complete so I can add them there? Right now I’m add them in on_data (from a subclass derived from default/exec.py).

0 Likes

#43

The finish() method in ExecCommand is where the code ends up when the build completes, so you can use that to know when the execution is complete (and if it failed or not as well, if that’s important).

An example of that is demonstrated here:

0 Likes

#44

Ok, I got it working now. Thanks for all your help.

0 Likes

#45

I’ve also run into this issue too, it’d be handy to have coz ctrl+r doesn’t work for a two line func def. eg

void blarblarblar
( lots and lots of complicated variables)
{
//actual stuff
}

ps sorry about the formatting issues, even spaces don’t work on this forum

0 Likes

#46

When you’re entering something in the forum that you want to be displayed exactly as is, then wrap it in a code block:

```
void something (int args, int arg)
{
    // Stuff goes here
}
```

gets displayed like this:

void something (int args, int arg)
{
    // Stuff goes here
}

Alternatively, you can select the text and use the </> (pre-formatted text) button in the editor. That indents all of the selected text by 4 characters and causes the forum to display it verbatim (you can also just indent the text manually):

This is some
long text that is
     formatted exactly
          as I
want
it.
0 Likes

#47

Oooh very handy. Thank you !!

0 Likes