<http://forum.pspad.com/read.php?f=2&i=12114&t=12082> 
----------------------------------------------------------------

hi, 

for block comment you should use scripts , it allows to extend much more
fonctionnalities in PSPad very simply. ( in PSPad/Script/JScript)

For example, i'd made this piece of code to comment blocks :

var ed = curEditor();// hand made function to insert in your script
var ext = getFileExtension( ed.FileName()); // hand made function to
insert in your script
var selText = ed.selText();
if ( selText == "") {
        if ( ext == "js") {
                ed.CaretX( 1);
                ed.lineText( "//" + ed.lineText());
        } else if ( ext == "xml" || ext == "xsl") {
                ed.CaretX( 1);
                ed.lineText( "<!-- " + ed.lineText() + " -->");
        }
} else {
        selLines = selText.split( "\n");
        selText = "";
        if ( ext == "js") {
                for ( i=0; i<selLines.length; i++)
                        if ( selLines[ i] != "") selText = selText + "//" + 
elLines[ i];
                ed.selText( selText);                   
        } else if ( ext == "xml" || ext == "xsl") {
                selText = "<!-- \n";
                for ( i=0; i<selLines.length; i++)
                        if ( selLines[ i] != "") selText = selText + selLines[ 
i];
                ed.selText( selText + "\n -->\n");              
                }
        }


it's very simple to adapt for CSS and all other languages

-- 
PSPad freeware editor http://www.pspad.com

Reply via email to