Commit Diff


commit - 5a824be4d587c867d1cd4bc0796bcbf6856dac1c
commit + d1353324e53286535a700303d379af37f94e83df
blob - b80e645a5b62a0badf23ea3ee74baf7f4f33905d
blob + 2fe5346dd4f33ba360dc7ebbe925293061ce3f55
--- minibuffer.c
+++ minibuffer.c
@@ -32,8 +32,8 @@ static void		 read_select(void);
 static void (*yornp_cb)(int, struct tab *);
 static struct tab *yornp_data;
 
-static void (*read_cb)(const char*, unsigned int);
-static unsigned int read_data;
+static void (*read_cb)(const char*, struct tab *);
+static struct tab *read_data;
 
 struct histhead eecmd_history,
 	ir_history,
@@ -284,8 +284,8 @@ yornp(const char *prompt, void (*fn)(int, struct tab*)
  * Not yet "completing", but soon maybe...
  */
 void
-completing_read(const char *prompt, void (*fn)(const char *, unsigned int),
-    unsigned int data)
+completing_read(const char *prompt, void (*fn)(const char *, struct tab *),
+    struct tab *data)
 {
 	size_t len;
 
blob - 5b4b4a41765c2935870f90262a5a1d4ab9a7855a
blob + 0f071031d53a8afd61783699b42ee014688d2710
--- minibuffer.h
+++ minibuffer.h
@@ -24,7 +24,7 @@ void	 enter_minibuffer(void(*)(void), void(*)(void), v
 void	 exit_minibuffer(void);
 void	 yornp(const char *, void (*)(int, struct tab *), struct tab *);
 void	 completing_read(const char *,
-	     void (*)(const char *, unsigned int),
-	     unsigned int);
+	     void (*)(const char *, struct tab *),
+	     struct tab *);
 
 #endif
blob - 0505b038e45cb48b6dbafced3caefa77878699ab
blob + 9bb15ae7fdce26c345458a97f8b15706703da122
--- telescope.c
+++ telescope.c
@@ -40,7 +40,7 @@ static void		 handle_maybe_save_new_cert(int, struct t
 static void		 handle_imsg_got_code(struct imsg*, size_t);
 static void		 handle_imsg_got_meta(struct imsg*, size_t);
 static void		 handle_maybe_save_page(int, struct tab *);
-static void		 handle_save_page_path(const char *, unsigned int);
+static void		 handle_save_page_path(const char *, struct tab *);
 static void		 handle_imsg_file_opened(struct imsg*, size_t);
 static void		 handle_imsg_buf(struct imsg*, size_t);
 static void		 handle_imsg_eof(struct imsg*, size_t);
@@ -319,25 +319,22 @@ static void
 handle_maybe_save_page(int dosave, struct tab *tab)
 {
 	if (dosave)
-		ui_read("Save to path", handle_save_page_path, tab->id);
+		ui_read("Save to path", handle_save_page_path, tab);
 	else
 		stop_tab(tab);
 }
 
 static void
-handle_save_page_path(const char *path, unsigned int tabid)
-{
-	struct tab *tab;
-
+handle_save_page_path(const char *path, struct tab *tab)
+{
 	if (path == NULL) {
-		stop_tab(tab_by_id(tabid));
+		stop_tab(tab);
 		return;
 	}
 
-	tab = tab_by_id(tabid);
 	tab->path = strdup(path);
 
-	ui_send_fs(IMSG_FILE_OPEN, tabid, path, strlen(path)+1);
+	ui_send_fs(IMSG_FILE_OPEN, tab->id, path, strlen(path)+1);
 }
 
 static void
blob - f287bbb47b1915171236717571a376358226e6b1
blob + abaa8f0ad8b9b15524ee52e1e77991bc7e6e4b0c
--- ui.c
+++ ui.c
@@ -1202,8 +1202,8 @@ ui_yornp(const char *prompt, void (*fn)(int, struct ta
 }
 
 void
-ui_read(const char *prompt, void (*fn)(const char*, unsigned int),
-    unsigned int data)
+ui_read(const char *prompt, void (*fn)(const char*, struct tab *),
+    struct tab *data)
 {
 	completing_read(prompt, fn, data);
 	redraw_tab(current_tab());
blob - 6e5be047ea41d7688ac36022396b3801e7b3075a
blob + f88c1530477be74f4bd8856b0c55dd1381795c9d
--- ui.h
+++ ui.h
@@ -134,7 +134,7 @@ const char	*ui_keyname(int);
 void		 ui_toggle_side_window(void);
 void		 ui_schedule_redraw(void);
 void		 ui_require_input(struct tab *, int);
-void		 ui_read(const char *, void (*)(const char *, unsigned int), unsigned int);
+void		 ui_read(const char *, void (*)(const char *, struct tab *), struct tab *);
 void		 ui_yornp(const char *, void (*)(int, struct tab *), struct tab *);
 void		 ui_end(void);