
#Ultracompare edit code#
The referenced script file uses different code to determine the beginning and end of the selection without temporarily modifying the file. Next the cut text is pasted back into the file resulting in caret being at end of the former selection and the properties currentLineNum and currentColumnNum can be used to to get line and column number at end of the former selection. The selection is cut to one of the user clipboards resulting in caret being at beginning of the former selection and the UltraEdit document properties currentLineNum and currentColumnNum can be used now to get line and column number at beginning of the selection. There is a simple method to get the line and column number at beginning of a selection and at end of a selection if it is possible to temporarily modify the file with the selection. So the current column number is the column number at beginning of the selection to create later by this function with the exception as written above. The column number at beginning of the selection is stored in property currentColumnNum for a selection made from bottom to top with caret blinking at beginning of selection. The column number stored in the UltraEdit document property currentColumnNum is the column number at end of a selection which was made from top to bottom as usually done here.

In this case the caret is at beginning of found string.
#Ultracompare edit windows#
The caret is at end of the found string and this position is also needed for the selection made later, except Perl regular expression engine is active and UE for Windows So it is necessary to find out if end of found string is on same line or a different line below to determine the line number at end of found string. The line number as stored in UltraEdit document property currentLineNum is always the line number at beginning of the found and selected string independent on how this selection was made before and in which direction.There is written in the comments for a selection in normal text edit mode inside function FindSelectInner:

I recommend to look on the code and especially the comments of the UltraEdit script file FindSelectInnerOuter.js with the two functions FindSelectInner and FindSelectOuter. It makes also a difference if a selection is made from top left to bottom right (normal direction) or from bottom right to top left (reverse direction). There are also three different types of selections: selection in normal text edit mode, a rectangular selection in column editing mode, and a selection in hex edit mode. The line and column number at beginning of a selection and at end of a selection cannot be easily determined as there are no UltraEdit document properties which hold the relevant numbers.
