line number – EmEditor (Text Editor) https://www.emeditor.com Best Text Editor, Code Editor, CSV Editor, Large File Viewer for Windows (Free versions available) Mon, 17 Feb 2020 18:42:30 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 Line number did not display properly in new verion (v19.6.0 x64, win 10) https://www.emeditor.com/forums/topic/line-number-did-not-display-properly-in-new-verion-v19-6-0-x64-win-10/ Mon, 17 Feb 2020 18:42:30 +0000 https://www.emeditor.com/forums/topic/line-number-did-not-display-properly-in-new-verion-v19-6-0-x64-win-10/ Hi there,

The Line number can’t display correctly after having upgraded to v19.6.0 (64bit, win 10 pro OS). Anyone has the same problem as me?

]]>
How to get the number of the last VISIBLE (filter-wise) line number in document? https://www.emeditor.com/forums/topic/how-to-get-the-number-of-the-last-visible-filter-wise-line-number-in-document/ Tue, 30 Aug 2016 22:51:22 +0000 https://www.emeditor.com/forums/topic/how-to-get-the-number-of-the-last-visible-filter-wise-line-number-in-document/ I’m using a macro (in Cell Selection Mode) to select all the data in the column where the “cell cursor” is currently at. It looks like this:

	document.selection.SetActivePoint(eePosCell, document.selection.GetActivePointX(eePosCell), 2, false);
	document.selection.SetActivePoint(eePosCell, document.selection.GetActivePointX(eePosCell), document.GetLines() - 1, true);

It works great when there is no active filter, but as soon as any line at the end of the file is currently filtered-out, it won’t work. It will then instead select all the columns including and to the left of the column where the “cell cursor” is currently at.

The simple explanation for this is that the expression “document.GetLines() – 1” will not move the cursor from the last (empty) line above it in the filtered data (because the line number of that line will still be less than “document.GetLines() – 1” if any lines have been filtered-out inbetween the end of the document and the last visible (= non-filtered out) line in the document). Thus, the cell cursor will “snap left” on the very last line of the file (which is always empty, therefore bringing the cell cursor all the way to the left, consequently selecting also all the columns to the left of the intended column).

So, my question is therefore: Is there any way to get the line numbers of only the visible lines (i.e. those that are not hidden by the filter) in a file, from a macro?

If not, how can I go about selecting the entire contents of a single column from a macro in the above described scenario?

Example data (with example line numbers to the left):

1: col1;col2;col3
2: 1;2;3
3: 11;22;33
4: 111;222;333
10:

In this case, lines 5-9 of the file have been filtered-out by a filter expression, therefore not being visible in the editor window.

So, what I want in this example is to get the number of the last visible line (i.e. nr 4, which is the last visible line before the very last line which in this case is nr 10, where the last one is always empty without any cells, except the “artificial” cell being placed to the very left), or any other method to reliably select the entire data contents (i.e. rows 2-4) of this column.

Are any of these two things currently possible from EmEditor macros, or could you otherwise possibly add the possibility to do any of these two things?

]]>