I'm editing an xml document.
I copy a collapsed section of text.
When I paste, it pastes expanded.
I would like it to paste as collapsed.
It this possible?
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.
// Is any file open and clipboard contains data?
if (UltraEdit.document.length > 0 && UltraEdit.clipboardContent.length > 0) {
UltraEdit.insertMode();
// Store the number of the active line and paste the clipboard content.
var nStartLine = UltraEdit.activeDocument.currentLineNum;
UltraEdit.activeDocument.paste();
// Get the number of the line after paste.
var nEndLine = UltraEdit.activeDocument.currentLineNum;
// Are at least 2 lines pasted in insert mode?
if ((nEndLine - nStartLine) > 1) {
// If the cursor is now not at start of a line, the clipboard content
// does not end with a line ending. Therefore insert a line ending at
// end of the file or set the cursor to start of the next line.
var nActColNum = UltraEdit.activeDocument.currentColumnNum;
if (typeof(UltraEdit.activeDocumentIdx) == "undefined") nActColNum++;
if (nActColNum != 1) {
if (UltraEdit.activeDocument.isEof()) {
UltraEdit.activeDocument.insertLine();
} else {
UltraEdit.activeDocument.gotoLine(++nEndLine,1);
}
}
// Select the pasted block again and collapse it.
UltraEdit.activeDocument.gotoLineSelect(nStartLine,1);
UltraEdit.activeDocument.hideOrShowLines();
// Set the cursor back to position after the pasted block.
UltraEdit.activeDocument.gotoLine(nEndLine,1);
}
}