

Make source file again the active file, paste over the selection active file is not available as scripting command. Then cut reformatted block to user clipboard 9.

Convert the XML block to a pretty printed XML block. UltraEdit.saveAs("C:\\Temp\\XmlConvertTmp.xml") syntax highlighting required for correct re-indenting the XML block.

Important is the file extension XML for this file to activate XML a fixed name and path overwriting existing file with that name. Paste the copied XML block into new file and save this file with Detected are UTF-8, UTF-16 LE and UTF-16 BE, but not ASCII Escaped Unicode. Convert the file to Unicode if source file is also a Unicode file. If (nLineTerm = 1) () Įlse if (nLineTerm = 2) () Convert the file to line terminator type of source file. Encoding and line terminator type for new files can be configured. Create a new file and convert it to ASCII with DOS line terminators. Copy the selection to user clipboard 9. Var nDocIndex = UltraEdit.activeDocumentIdx Determine document index, line terminator type and encoding of active file. If (typeof(lumnModeOff) = "function") lumnModeOff() Įlse if (typeof() = "function") () Just in case of file, on which XML convert to CR/LFs is executed (usually active), is syntax highlighted with a language containing XML_LANG, the indent/unindent strings as defined for this syntax highlighting language should be used if there are such strings defined in the wordfile at all overriding the built-in defaults.Ī workaround for this issue for your use case would be following script code:Ĭode: Select all // Something must be selected in active file, either entire file or just a single block.

In my opinion the command XML convert to CR/LFs should use always the indent/unindent settings as defined internally in UltraEdit for XML highlighted files independent on file is not syntax highlighted at all or syntax highlighted with a language not containing XML_LANG. I will report this by email to IDM support. So the problem on usage of () on a file not syntax highlighted as XML file is that UltraEdit does not use the indent/unindent settings as defined internally for XML highlighted files. But when manually hitting key TAB, the line is indented according to tab stop and indent value settings configured for the type of file according to its file extension. Using XML Convert to CR/LFs on a file not syntax highlighted at all results in correct inserting line terminators, but the lines are not re-indented and therefore no line has leading spaces or tabs.Using XML Convert to CR/LFs on a file syntax highlighted with any language containing XML_LANG in first line results in correct inserting line terminators and additionally re-indenting all lines according to XML indent/unindent settings as defined within UltraEdit taking the tab stop/indent value settings into account as configured for the active file according to its file extension.I played 2 minutes with this command on a not syntax highlighted file and detected following. Okay, thanks for letting us know why you think it is necessary to change the syntax highlighting for your task.Īs I wrote at "XML convert to CR/LFs" disabled for read-only files, it is since UE v17.10 always possible to use the command XML Convert to CR/LFs independent on file type and syntax highlighting.
