-
Notifications
You must be signed in to change notification settings - Fork 18
Whitespace glitch when updating #2
Copy link
Copy link
Closed
Description
Thanks for creating this library -- it looks really promising.
I ran into a problem while trying to render a live-updated table. It can be boiled down to:
const frames = [
`
┌─┐
│ │
`,
`
┌────┐
│ │
`
];
const diffy = require('diffy')();
const trim = require('diffy/trim');
let nextFrameNumber = 0;
diffy.render(() => trim(`
${frames[nextFrameNumber++]}
`));
setTimeout(() => diffy.render(), 1000);Expected output:
┌─┐
│ │
and then:
┌────┐
│ │
Actual output:
┌─┐
│ │
and then:
┌────┐
││
Reproduced with the Gnome Terminal on Ubuntu.
Seems like removing the whitespace between trim(` and ${ corrects the output, so I hope it's an easy fix :)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels