Skip to content

Commit f596a3c

Browse files
mahendrapaipurimwouts
authored andcommitted
fix: Ensure we set jupytext metadata to model
* When selectedFormts are empty, we return before setting jupytext metadata * So, the changes are not being comitted to notebook model * This commit fixes it by ensuring we always set metadata before returning * Use console.debug instead of console.log to reduce log pollution Signed-off-by: Mahendra Paipuri <[email protected]>
1 parent 6c4b670 commit f596a3c

File tree

1 file changed

+3
-3
lines changed
  • jupyterlab/packages/jupyterlab-jupytext-extension/src

1 file changed

+3
-3
lines changed

jupyterlab/packages/jupyterlab-jupytext-extension/src/commands.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ export function executePairCommand(
182182
let selectedFormats = getSelectedFormats(notebookTracker);
183183

184184
// Toggle the selected format
185-
console.log('Jupytext: executing command=' + command, selectedFormats);
185+
console.debug('Jupytext: executing command=' + command);
186186
if (format === 'custom') {
187187
showErrorMessage(
188188
trans.__('Error'),
@@ -256,8 +256,8 @@ export function executePairCommand(
256256
}
257257
if (Object.keys(jupytext).length === 0) {
258258
(model as any).deleteMetadata('jupytext');
259-
(model as any).setMetadata('jupytext', jupytext);
260259
}
260+
(model as any).setMetadata('jupytext', jupytext);
261261
return;
262262
}
263263

@@ -332,7 +332,7 @@ export function isMetadataCommandEnabled(
332332
export function executeMetadataCommand(
333333
notebookTracker: INotebookTracker
334334
): void {
335-
console.log('Jupytext: toggling YAML header');
335+
console.debug('Jupytext: toggling YAML header');
336336
if (!notebookTracker.currentWidget) {
337337
return;
338338
}

0 commit comments

Comments
 (0)