Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #28050
    LifeTimer
    Participant

    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?

    #28056
    Yutaka Emura
    Keymaster

    I think the newer behavior is correct, but I might be misunderstanding. To reproduce the issue, can you write a simple test case?

    #28058
    LifeTimer
    Participant

    Sure, here is a simple test case:

    1.
    Save the following macro code to a macro:

    col = document.selection.GetActivePointX(eePosCell)
    document.Filter(document.selection.Text, col, eeFindKeepPrevious | eeFindNegative);

    2.
    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
    

    3.
    Select the cell on line 1 with the string “aaa” in it.

    4.
    Run the macro (I use a hot-key to run it).

    5.
    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!

    #28059
    Yutaka Emura
    Keymaster

    Hello,
    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,

    #28060
    LifeTimer
    Participant

    Thanks a lot for your quick response and fix, as usual!

Viewing 5 posts - 1 through 5 (of 5 total)
  • You must be logged in to reply to this topic.