summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog2
-rw-r--r--plugins/perl/alt_completion.pl8
-rw-r--r--src/common/inbound.c2
3 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index d32a6851..e8839f0c 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -14,6 +14,8 @@ highlights. The full CVS log is available at www.xchat.org/cvslog/
 ------------------------------------------------------------------------------
  2.8.10 - dd/mm/yyyy
 ------------------------------------------------------------------------------
+ - Emit the Topic Change event before setting the topic internally so plugins
+   can access the old topic inside the callback.
  - Perl (Lian Wan Situ)
   * Added two new options to hook_print, run_after_event and filter. See
     documentation for details.
diff --git a/plugins/perl/alt_completion.pl b/plugins/perl/alt_completion.pl
index 2572fb81..71c1884d 100644
--- a/plugins/perl/alt_completion.pl
+++ b/plugins/perl/alt_completion.pl
@@ -30,8 +30,11 @@ my $ignore_leading_non_alnum = 0;
 my $path_completion = 1;
 my $base_path = '';
 
+# ignore the completion_amount setting and always cycle through nicks with tab
+my $always_cycle = 0;
+
 Xchat::register(
-	"Tab Completion", "1.0401", "Alternative tab completion behavior"
+	"Tab Completion", "1.0500", "Alternative tab completion behavior"
 );
 Xchat::hook_print( "Key Press", \&complete );
 Xchat::hook_print( "Close Context", \&close_context );
@@ -203,8 +206,9 @@ sub complete {
 		# don't cycle if the number of possible completions is greater than
 		# completion_amount
 		if(
+			!$always_cycle && (
 			@{$completions->{matches}} > $completion_amount
-			&& @{$completions->{matches}} != 1
+			&& @{$completions->{matches}} != 1 )
 		) {
 			# don't print if we tabbed in the beginning and the list of possible
 			# completions includes all nicks in the channel
diff --git a/src/common/inbound.c b/src/common/inbound.c
index 41f5cff3..1d621583 100644
--- a/src/common/inbound.c
+++ b/src/common/inbound.c
@@ -683,10 +683,10 @@ inbound_topicnew (server *serv, char *nick, char *chan, char *topic)
 	sess = find_channel (serv, chan);
 	if (sess)
 	{
+		EMIT_SIGNAL (XP_TE_NEWTOPIC, sess, nick, topic, chan, NULL, 0);
 		stripped_topic = strip_color (topic, -1, STRIP_ALL);
 		set_topic (sess, topic, stripped_topic);
 		g_free (stripped_topic);
-		EMIT_SIGNAL (XP_TE_NEWTOPIC, sess, nick, topic, chan, NULL, 0);
 	}
 }