saqimtiaz / streams

TiddlyWiki plugin for rapid data entry with a keyboard driven workflow. Divide content into smaller tiddlers as you write.
BSD 3-Clause "New" or "Revised" License
58 stars 6 forks source link

Longer text - enter and alt-enter glitch? #1

Closed Wattaged closed 4 years ago

Wattaged commented 4 years ago

Thanks for this, it is very useful.

I've hit 2 quirks that I haven't been able to solve. Tested on a local, fresh, single-file TW 5.1.22 and your own demo site with streams 0.1.7. on Firefox 77.0.1. Linux

  1. Expected: press enter to split text at cursor producing a 2nd node containing remainder of text. Experienced: enter deletes text after the cursor.

To reproduce: Create a new tiddler 'Test', save and click the streams button. Into the fresh stream 'editor' copy paste this longer post - from the TW forum https://groups.google.com/forum/#!msg/TiddlyWiki/tTUKcHOObE0/zvBLRGDcBgAJ Place the cursor at the end of the first paragraph, press enter, all the following text disappears.

  1. Expected: alt-enter to split longer text at each double new line and produce multiple nodes. Experienced: alt-enter deletes text.

To reproduce; Create a new tiddler 'Test', save and hit the streams button. Into the fresh stream editor copy paste this longer post - from the TW forum https://groups.google.com/forum/#!msg/TiddlyWiki/tTUKcHOObE0/zvBLRGDcBgAJ Press alt-enter with the cursor at the start of the text and the text disappears. Press alt-enter with cursor at the end of the text and a single empty new node is created, original text remains. Press alt-enter with cursor in the middle of a word or start of a paragraph and it splits the text at the cursor producing 2 nodes. (What I was expecting 'enter' to do.)

I tried a different piece of text from 'Great Expectations' here; http://www.gutenberg.org/files/1400/1400-0.txt A different result! Quirk 1 - pressing enter works as expected. Text is split at the cursor, a new node is produced with the remainder. Quirk 2 - pressing alt-enter works but only to split once (it works the same as 'enter'). It doesn't split on double new lines to produce multiples.

I've checked that there are /n/n breaks in the text for alt-enter to find and they seem to be there, I put some more in just to be sure. I hope I'm not doing something thick and causing you unnecessary work. Thanks for a useful, elegant plugin.

saqimtiaz commented 4 years ago

@Wattaged thank you for a well written and helpful bug report.

I've pushed some changes that should resolve both issues. Please do test and confirm when you get the chance.

Wattaged commented 4 years ago

Tested and both shortcuts are now working as expected. Thank you very much, it's a really nice plugin!