CloseOnCancelPlugin enhancement OR bug fix

12 views
Skip to first unread message

RA

unread,
Nov 20, 2009, 7:58:01 PM11/20/09
to TiddlyWiki
For an existing tiddler, if you hit Esc accidentally while editing,
you can hit Esc again at the confirmation dialog and keep editing. But
if it's a new tiddler, the CloseOnCancelPlugin will close the tiddler,
regardless of how you respond to the confirmation dialog. So if you
never saved your new big tiddler before, if you hit Esc once (very
likely if you are a Vi user, I imagine), you are screwed no matter
what. To change that, here's the fix:

change
if (!store.tiddlerExists(title) && !store.isShadowTiddler(title))
to
if (!story.isDirty(title) && !store.tiddlerExists(title) && !
store.isShadowTiddler(title))

This doesn't look very elegant, but I couldn't think of a better one.
Does a handler have to always return false? Otherwise,
config.commands.cancelTiddler.handler could be changed to return true
or false depending on the confirmation.

Tobias Beer

unread,
Nov 20, 2009, 10:15:14 PM11/20/09
to TiddlyWiki
Ho RA,

As for me, personally, that's the kind of stuff that I wouldn't want.
Often I find myself canceling out of an accidental action, which I
really don't want to have to confirm. I'd prefer learning the hard
way, when to hit which key (or to do a ctrl-c beforehand) ...instead
of being 'annoyed' by questions along the lines of "Do you really want
to abandon the changes you never made or intended in the first
place?!?!?!?".

;-)

Tobias.

Simon Baird

unread,
Apr 13, 2010, 8:05:27 AM4/13/10
to tiddl...@googlegroups.com
RA,

Excellent. I have added an issue for this.


Should be fixed in an upcoming release.

Simon.


--

You received this message because you are subscribed to the Google Groups "TiddlyWiki" group.
To post to this group, send email to tiddl...@googlegroups.com.
To unsubscribe from this group, send email to tiddlywiki+...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tiddlywiki?hl=.





--
simon...@gmail.com
Reply all
Reply to author
Forward
0 new messages