It would be nice to have highlighting of matching block idenfifiers (def...end, if...end etc..) as they were paretheses, like RubyMine does.
That should be done in a plugin.
I was taking a look at a plugin that does something similar (html autocomplete), however I was wondering if it was possible to use the scintilla api to get the matching identifiers (it already finds them correctly, since folding works good). From what I read, the aformentioned plugin does a search to find matching html tags, but it seems redundant to me.
The HTML one probably does a search since folding is per-line only and HTML closes are often on the same line. If your language is assured to have closing constructs on separate lines then you can use the folding data.
The scope shown in the status bar uses it to find the start of a block to find the symbol to look up I think, maybe have a look at how it works.
Specifically http://www.scintilla.org/ScintillaDoc.html#SCI_GETFOLDLEVEL
Something like (pseudo code):
``` curLine = GetCurrentLine(); curFoldLevel = GetFoldLevel(curLine++); while (!endOfFile) { thisFoldLevel = GetFoldLevel(curLine++); if (thisFoldLevel == curFoldLevel) { // this is the matching closing line } } ```
It wouldn't work if ruby allows the block ending on the same line as the block start though (I don't know ruby).
github-comments@lists.geany.org