Welcome to the IDM Forum. This forum is meant as a user-to-user support mechanism where users can share knowledge and tips for all IDM software.
Since these forums are user-to-user based, IDM does not regularly read or reply to the posts in this forum. For problem reports, suggestions, or feature requests, you must email us directly. Our trained technical support staff answers most inquiries within 30 minutes.

//============================================================================
//
// Filename: Kill_Indentation_Exceptionally.js
//
// Description: Indentation switching on/off on per file type basis
// 1) Switch Auto Indentation on
// ( Configuration -> Editor Display -> Formatting )
// 2) Add file extensions you want to have auto
// indentation for in untouchable list
// 3) Associate this script with Return key
//
//---------------- UltraEdit scripting API version indicator -----------------
//
// Version = 1.00
//
//============================================================================
var untouchable =
[
"c", "cc", "cpp", "cxx",
"h", "hh", "hpp", "hxx",
"js", "java",
"php",
"html",
"pas", "pp",
"py"
];
//----------------------------------------------------------------------------
function imitate_return()
{
//UltraEdit.columnModeOff();
UltraEdit.activeDocument.startSelect();
UltraEdit.activeDocument.key( "END" );
UltraEdit.activeDocument.endSelect();
var clipboard;
var was_selected = UltraEdit.activeDocument.isSel();
if ( was_selected )
{
clipboard = UltraEdit.clipboardContent;
UltraEdit.activeDocument.cut();
}
UltraEdit.activeDocument.insertLine();
if ( was_selected )
{
var column = UltraEdit.activeDocument.currentColumnNum;
if (typeof(UltraEdit.activeDocumentIdx) == "undefined") column++;
UltraEdit.activeDocument.paste();
UltraEdit.clipboardContent = clipboard;
UltraEdit.activeDocument.gotoLine( 0, column );
}
}
//============================================================================
imitate_return();
var indentation_killing = true;
for ( var i = untouchable.length; --i >= 0; )
{
//UltraEdit.messageBox( untouchable[i] );
if ( UltraEdit.activeDocument.isExt( untouchable[i] ) )
{
indentation_killing = false;
break;
}
}
if ( indentation_killing )
{
UltraEdit.activeDocument.deleteToStartOfLine();
}
//============================================================================