- February 16, 2022 at 7:17 pm #28050
Somewhere between version 17.2.2 and the most recent version of EmEditor, there was seemingly a bug introduced in the document.Filter() macro function, as follows:
Consider this macro command:
document.Filter(any_non_empty_static_string_here, col_number_here, eeFindKeepPrevious | eeFindNegative);
Previously (e.g. in version 17.2.2) it worked as expected, and only filtered out the string in the any_non_empty_static_string_here parameter, but in the most recent version, it also filters out all empty cells, which breaks my macro completely!
I assume that this was not done on purpose, and is therefore a bug, right?February 19, 2022 at 2:38 pm #28056Yutaka EmuraKeymaster
I think the newer behavior is correct, but I might be misunderstanding. To reproduce the issue, can you write a simple test case?February 19, 2022 at 5:49 pm #28058
Sure, here is a simple test case:
Save the following macro code to a macro:
col = document.selection.GetActivePointX(eePosCell) document.Filter(document.selection.Text, col, eeFindKeepPrevious | eeFindNegative);
Load a CSV file with the following contents in the most recent version of EmEditor (in Cell Mode):
LineNr,String,Description 1,aaa,This line SHOULD be filtered-out 2,aaa,This line SHOULD ALSO be filtered-out 3,,This line and the line below should NOT be filtered-out 4,bbb,This line and the line above should NOT be filtered-out
Select the cell on line 1 with the string “aaa” in it.
Run the macro (I use a hot-key to run it).
The result is that ONLY line 4 remains visible, while the expected result is that BOTH line 3 and 4 should remain visible, right?
If you don’t agree, please explain to me why empty cells should match the filter when I explicitly tell the filter to match a certain string (in this case “aaa”)?
Thanks!February 20, 2022 at 2:56 pm #28059Yutaka EmuraKeymaster
I’ve reproduced the issue, and it is fixed on v21.5.902. Please update to the latest version.
I also added this test case to our test macros.
Thank you,February 20, 2022 at 3:07 pm #28060
Thanks a lot for your quick response and fix, as usual!
- You must be logged in to reply to this topic.