SlickEdit Product Discussion > Slick-C® Macro Programming

Same Line Braces macro - insert {} on current line

(1/1)

ewjax:
From the source file (see attached):


--- Code: ---#include "slick.sh"


// 
// simple macro to put two braces in the file, without auto-expanding them
// this is useful for one-line functions in .h files, for example
//   
// original author:  Elliott W. Jackson
//
_command SameLineBraces()
{
   // save insert mode, and set mode to insert
   int insertstate;
   insertstate = _insert_state();
   _insert_state(1);

   _insert_text("{}"); 
   cursor_left();

   // restore original insert mode
   _insert_state(insertstate);
}

--- End code ---

Navigation

[0] Message Index

Go to full version