use same numbers for pager(responses) and thread(articles) view

Rado S <[email protected]> Fri, 25 May 2007 20:44:26 +0200
Newsgroups gmane.network.tin.devel
Message-ID <[email protected]>
Moin,

again picking up an old subject, let me quote myself:
------ QUOTE BEGIN ------
When in the pager I hit #4, it jumps to a different message than
when I hit #4 in the thread view. This is ... confusing.
Shouldn't the same number jumped to refer to the same message
in the thread independent of viewing mode?
------- QUOTE END -------

It should, therefore I patch it as attached.

-- 
© Rado S. -- You must provide YOUR effort for your goal!
EVERY effort counts: at least to show your attitude.
You're responsible for ALL you do: you get what you give.
samenumber.pat (text/plain, 2.3 KB)
diff -ur torg/include/proto.h tgo/include/proto.h
--- torg/include/proto.h	Tue Mar 27 20:25:48 2007
+++ tgo/include/proto.h	Fri May 25 20:32:42 2007
@@ -205,7 +205,7 @@
 extern void top_of_list(void);
 extern void end_of_list(void);
 extern void move_to_item(int n);
-extern void prompt_item_num(int ch, const char *prompt);
+extern void prompt_item_num(int startwith, int ch, const char *prompt);
 extern void scroll_down(void);
 extern void scroll_up(void);
 extern void set_first_screen_item(void);
diff -ur torg/src/global.c tgo/src/global.c
--- torg/src/global.c	Tue Mar 27 20:25:48 2007
+++ tgo/src/global.c	Fri May 25 20:31:25 2007
@@ -195,6 +195,7 @@
 
 void
 prompt_item_num(
+	int startwith,
 	int ch,
 	const char *prompt)
 {
@@ -213,7 +214,7 @@
 	if (num >= currmenu->max)
 		num = currmenu->max - 1;
 
-	move_to_item(num);
+	move_to_item(num+1-startwith);
 }
 
 
diff -ur torg/src/group.c tgo/src/group.c
--- torg/src/group.c	Tue Mar 27 20:25:48 2007
+++ tgo/src/group.c	Fri May 25 20:30:24 2007
@@ -214,7 +214,7 @@
 			case DIGIT_8:
 			case DIGIT_9:
 				if (grpmenu.max)
-					prompt_item_num(func_to_key(func, group_keys), _(txt_select_thread));
+					prompt_item_num(1,func_to_key(func, group_keys), _(txt_select_thread));
 				break;
 
 #	ifndef NO_SHELL_ESCAPE
diff -ur torg/src/select.c tgo/src/select.c
--- torg/src/select.c	Tue Mar 27 20:25:48 2007
+++ tgo/src/select.c	Fri May 25 20:31:45 2007
@@ -146,7 +146,7 @@
 			case DIGIT_8:
 			case DIGIT_9:
 				if (selmenu.max)
-					prompt_item_num(func_to_key(func, select_keys), _(txt_select_group));
+					prompt_item_num(1,func_to_key(func, select_keys), _(txt_select_group));
 				else
 					info_message(_(txt_no_groups));
 				break;
diff -ur torg/src/thread.c tgo/src/thread.c
--- torg/src/thread.c	Tue Mar 27 20:25:48 2007
+++ tgo/src/thread.c	Fri May 25 20:32:02 2007
@@ -152,7 +152,7 @@
 		sprintf(buffer, "%s ", tin_ltoa(l + 1, 6));
 	else
 #endif /* 0 */
-	sprintf(buffer, "  %s ", tin_ltoa(l + 1, 4));
+	sprintf(buffer, "  %s ", tin_ltoa(l , 4));
 	rest_of_line -= 7;
 
 	/*
@@ -482,7 +482,7 @@
 				if (thdmenu.max == 1)
 					info_message(_(txt_no_responses));
 				else
-					prompt_item_num(func_to_key(func, thread_keys), _(txt_select_art));
+					prompt_item_num(0,func_to_key(func, thread_keys), _(txt_select_art));
 				break;
 
 #ifndef NO_SHELL_ESCAPE