Skip to content

Commit

Permalink
Fix last line chat
Browse files Browse the repository at this point in the history
See #80
  • Loading branch information
TristanCacqueray committed Jan 26, 2025
1 parent 935df95 commit 9c28ad4
Showing 1 changed file with 3 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

0 comments on commit 9c28ad4

Please sign in to comment.