Skip to content

can't replay commands on hidden columns #2849

@midichef

Description

@midichef

Small description
a .vdj replay file cannot apply commands to hidden columns

Steps to reproduce
cd sample_data; vd -p replay.vdj where replay.vdj has:

#!vd -p
{"longname": "open-file", "input": "benchmark.csv", "keystrokes": "o", "replayable": true}
{"sheet": "benchmark", "col": "Paid", "row": "", "longname": "hide-col", "input": "", "keystrokes": "-", "comment": "hide the current column", "replayable": true}
{"sheet": "benchmark", "col": "Paid", "row": "", "longname": "resize-col-max", "input": "", "keystrokes": "_", "comment": "toggle width of current column between full and default width", "replayable": true}

The last command, which unhides the hidden column, causes warnings:
no "Paid" column on benchmark
replay aborted during resize-col-max

The problem is the use of moveToCol in moveToReplayContext:

vs.moveToCol(r.col) or vd.error(f'no "{r.col}" column on {vs}')

moveToCol() only checks visible columns, not hidden ones:
vcolidx = indexMatch(vs.visibleCols, lambda c,name=col: name == c.name)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions