Skip to content

fix: fixes PushHide/PopHide mixing with Hide/UnHide - #927

Open
cbmarini wants to merge 1 commit into
form-dev:masterfrom
cbmarini:issue-828
Open

cbmarini wants to merge 1 commit into
form-dev:masterfrom
cbmarini:issue-828

Conversation

@cbmarini

Copy link
Copy Markdown
Collaborator

This PR fixes #828 by correcting how PushHide/PopHide interact with Hide/UnHide.

The intended rules are:

  • If PushHide hides F1 and a later Hide hides F2, UnHide; activates only F2; F1 stays hidden.
  • PopHide; activates both F1 and F2.
  • Expressions hidden before that PushHide stay hidden.

An example:

    Local F1 = 1;
    .sort
    PushHide;
    Local F2 = 2;
    .sort
    Hide;
    Local F3 = 3;
    .sort
    PushHide;
    Local F4 = 4;
    .sort
    Hide;
    .sort
    PopHide;
    #message Active expressions: `activeexprnames_'
~~~Active expressions: F3,F4
    .sort
    UnHide;
    #message Active expressions: `activeexprnames_'
~~~Active expressions: F2,F3,F4
    .sort
    PopHide;
    #message Active expressions: `activeexprnames_'
~~~Active expressions: F1,F2,F3,F4
    .end

A separate comment on the issue reports that Hide F4; was silently accepted even though F4 was not a declared expression. This PR also resolves that issue.

Question: Do we need to extend PushHide with PushHide [function-name] as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

PushHide and PopHide together with regular Hide statement

1 participant