From 935df9572316c45af299751c2d7f1c53c44cb8c1 Mon Sep 17 00:00:00 2001 From: Tristan de Cacqueray Date: Sun, 26 Jan 2025 06:42:59 -0500 Subject: [PATCH 1/2] Quick fix type error --- src/strudel.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/strudel.js b/src/strudel.js index d3dc753..2a9d076 100644 --- a/src/strudel.js +++ b/src/strudel.js @@ -192,6 +192,13 @@ export class StrudelSession { pattern = this.allTransform(pattern); } + // fix `pattern.fmap is not a function` exception, + // which happens when the pattern is the hubda function. + // TODO: figure out why this is happening, that sounds like a bug with the nudel std lib. + if (typeof pattern === 'function') { + return; + } + // fft wiring if (this.enableAutoAnalyze) { pattern = pattern.fmap((value) => { From 9c28ad4979fcb959da34acf0d42092b3ec9cd6a1 Mon Sep 17 00:00:00 2001 From: Tristan de Cacqueray Date: Sun, 26 Jan 2025 08:26:32 -0500 Subject: [PATCH 2/2] Fix last line chat See #80 --- src/editor.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/editor.js b/src/editor.js index e94e240..e69f430 100644 --- a/src/editor.js +++ b/src/editor.js @@ -97,6 +97,9 @@ export class PastaMirror { to = line.to + 1; } + // Ensure the removal works when the cursor is on the last line + // see: #80 + to = Math.min(to, view.state.doc.length); const message = view.state.sliceDoc(from, to).trim(); doc.session._pubSubClient.publish(`session:pastagang:chat`, { docId: doc.id,