devillemereuil added a comment.
I will have a go at it. It doesn't seem very complicated indeed, but I just don't have much time right now for this. @tfry I'm not sure what your pseudo-code is intended to replace? The parts using countClosing? FYI, these snippets of code were copied from the Python script. I learned JS on the go here, which is why I'm using very little idiosyncrasies from the language (apart from what I saw on the other scripts, mainly Python and Cstyle, with a few things picked up on Stack Overflow, I've got to admit...), so it's quite possible the script is not as elegant as it could be. REPOSITORY R39 KTextEditor REVISION DETAIL https://phabricator.kde.org/D12587 To: devillemereuil, #ktexteditor, #rkward Cc: tfry, dhaumann, #frameworks, michaelh, kevinapavew, ngraham, bruns, demsking, cullmann, sars