Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/pastagang/nudel
Browse files Browse the repository at this point in the history
  • Loading branch information
TodePond committed Jan 27, 2025
2 parents 2ba6088 + 9c28ad4 commit 305ca1d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/editor.js
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 7 additions & 0 deletions src/strudel.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) => {
Expand Down

0 comments on commit 305ca1d

Please sign in to comment.