Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[misc-] add sync to ensureLoaded in guide, macros, sysedit, vdx #2352

Merged
merged 4 commits into from
May 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions visidata/cmdlog.py
Original file line number Diff line number Diff line change
Expand Up @@ -323,6 +323,7 @@ def __exit__(self, exc_type, exc_val, tb):
def replay_sync(vd, cmdlog):
'Replay all commands in *cmdlog*.'
with vd.DisableAsync():
vd.sync() #2352 let cmdlog finish loading
cmdlog.cursorRowIndex = 0
vd.currentReplay = cmdlog

Expand Down
2 changes: 1 addition & 1 deletion visidata/features/sysedit.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def syseditCells_async(sheet, cols, rows, filetype=None):
vd.sync(tempvs.ensureLoaded())

while isinstance(tempvs, IndexSheet):
tempvs.ensureLoaded()
vd.sync(tempvs.ensureLoaded())
tempvs = tempvs.rows[0]

for col in sheet.visibleCols:
Expand Down
2 changes: 1 addition & 1 deletion visidata/guide.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ class CommandHelpGetter:
def __init__(self, cls):
self.cls = cls
self.helpsheet = vd.HelpSheet()
self.helpsheet.ensureLoaded()
vd.sync(self.helpsheet.ensureLoaded())

def __getattr__(self, k):
return self.__getitem__(k)
Expand Down
2 changes: 1 addition & 1 deletion visidata/loaders/vdx.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ def save_vdx(vd, p, *vsheets):
def runvdx(vd, vdx:str):
for line in Progress(vdx.splitlines()):
vs = vd.sheet or Sheet()
vs.ensureLoaded()
vd.sync(vs.ensureLoaded())
line = line.strip()
if not line or line[0] == '#':
continue
Expand Down