Sublime Forum

Display incomplete enclosures

#1

I do most of my coding in C and Python. I’m sure many have written code where statements that require parentheses, brackets, or braces have run off the top of the screen and is difficult to make sure that the enclosures line up correctly. It would be a very nice feature if the last enclosure statement (the one with the largest line number) was displayed at the top of the screen until the matching enclosure is entered, then move on to the next one. For example,

if (){
if ({

  1. The first display at the top would show: if ({
  2. This display would stay until it was corrected to include ‘)’
  3. It would still stay there until its matching brace appeared; unless code that is entered later has incomplete enclosures.
  4. Then the next line up would be displayed: if(){

Since I’m fairly new, I don’t know how sound this is. Thanks for taking the time to consider this.

0 Likes

#2

there may be some existing plugins that already do this:
https://packagecontrol.io/packages/BracketGuard
https://packagecontrol.io/packages/BracketHighlighter (see https://github.com/facelessuser/BracketHighlighter/issues/307#issuecomment-228560610)

0 Likes