NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
Show opening statement when closing curly brace is selected


Joined: 14 Sep 2010
Posts: 18
Reply with quote
I would like to see the opening statement whenever I select/highlight a closing curly brace /bracket.

Then I would not have to scroll up the page (or split the document) to remember which block of code I'm in.

Actually the start of the relevant code-block could be displayed somewhere whenever the cursor is "inside" it.

This feature would save me a massive amount of time.

For example:
Code:

function some_func()
{
    if ( ! $db = db_connect())
    {
        return false;
    }
    else
    {
        if ( ! $stmt = $db->prepare($sql))
        {
            return false;
        }
        else
        {   
            $stmt->bind_param('s', $request_slug);
           
            $request_slug = substr($_SERVER['REQUEST_URI'], 1);
           
            if ( ! $stmt->execute())
            {
                return false;   
            }
            else
            {
               $stmt->store_result();
               
               if ($stmt->num_rows == 1)
               {
                   $stmt->bind_result($controller);
                   
                   $stmt->fetch();
                   
                   $stmt->close();
                   
                   return $controller;
               }
            } // brace 1
        } // brace 2
    }
}//brace 3

When "brace 1" is highlighted I would like to see something similar to the following (next to the cursor):
Quote:

END: if ( ! $stmt->execute()) else {

I even made it easy for you (no need to reverse engineer the logic)

Similarly when the cursor is to the right of "brace 2", I would like to see:
Quote:

END: if ( ! $stmt = $db->prepare($sql)) else {


When the cursor is to the right of the "brace 3", I would like to see:
Quote:

END: function some_func()


Thank you!
View user's profileFind all posts by hurrakanSend private message
Show opening statement when closing curly brace is selected
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic