Index: edit-comments.dev.js
===================================================================
--- edit-comments.dev.js	(revision 12539)
+++ edit-comments.dev.js	(working copy)
@@ -260,7 +260,20 @@
 	},
 
 	toggle : function(el) {
-		if ( $(el).css('display') != 'none' )
+		if ( $(el).css('display') == 'none' )
+			return;
+		var replyrow = $('#replyrow');
+		var inlinerow = $('#inline-'+$('#comment_ID', replyrow).val());
+		// check if an open reply/edit row is dirty
+		if ( replyrow.css('display') == 'none'
+			|| ( $('#replyhead', replyrow).css('display') != 'none' && $('#replycontent', replyrow).val() == '' )
+			|| ( $('#edithead', replyrow).css('display') != 'none'
+				&& $('#replycontent', replyrow).val() == $('textarea.comment', inlinerow).val()
+				&& $('#author', replyrow).val() == $('div.author', inlinerow).text()
+				&& $('#author-email', replyrow).val() == $('div.author-email', inlinerow).text()
+				&& $('#author-url', replyrow).val() == $('div.author-url', inlinerow).text()
+			)
+		 )
 			$(el).find('a.vim-q').click();
 	},
 
