Ticket #2170: Color collisions
[midnight-commander.git] / src / editor / editcmd_dialogs.c
blobfcc05efa0cee60f8f80ca9d0ff2986bc990405f7
1 /*
2 Editor dialogs for high level editing commands
4 Copyright (C) 2009 The Free Software Foundation, Inc.
6 Written by:
7 Slava Zanko <slavazanko@gmail.com>, 2009.
9 This file is part of the Midnight Commander.
11 The Midnight Commander is free software; you can redistribute it
12 and/or modify it under the terms of the GNU General Public License as
13 published by the Free Software Foundation; either version 2 of the
14 License, or (at your option) any later version.
16 The Midnight Commander is distributed in the hope that it will be
17 useful, but WITHOUT ANY WARRANTY; without even the implied warranty
18 of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 General Public License for more details.
21 You should have received a copy of the GNU General Public License
22 along with this program; if not, write to the Free Software
23 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
24 MA 02110-1301, USA.
27 #include <config.h>
29 #include "lib/global.h"
30 #include "lib/tty/tty.h"
31 #include "lib/skin.h" /* INPUT_COLOR */
32 #include "lib/tty/key.h"
33 #include "lib/search.h"
34 #include "lib/strutil.h"
36 #include "src/dialog.h"
37 #include "src/widget.h"
38 #include "src/wtools.h"
39 #include "src/main.h"
40 #include "src/history.h"
41 #include "src/charsets.h"
43 #include "src/editor/edit-widget.h"
44 #include "src/editor/etags.h"
45 #include "src/editor/editcmd_dialogs.h"
48 /*** global variables **************************************************/
50 edit_search_options_t edit_search_options = {
51 .type = MC_SEARCH_T_NORMAL,
52 .case_sens = FALSE,
53 .backwards = FALSE,
54 .only_in_selection = FALSE,
55 .whole_words = FALSE,
56 .all_codepages = FALSE
59 /*** file scope macro definitions **************************************/
61 #define SEARCH_DLG_WIDTH 58
62 #define SEARCH_DLG_MIN_HEIGHT 13
63 #define SEARCH_DLG_HEIGHT_SUPPLY 3
65 #define REPLACE_DLG_WIDTH 58
66 #define REPLACE_DLG_MIN_HEIGHT 17
67 #define REPLACE_DLG_HEIGHT_SUPPLY 5
69 /*** file scope type declarations **************************************/
71 /*** file scope variables **********************************************/
73 /*** file scope functions **********************************************/
75 static cb_ret_t
76 editcmd_dialog_raw_key_query_cb (struct Dlg_head *h, Widget * sender,
77 dlg_msg_t msg, int parm, void *data)
79 switch (msg)
81 case DLG_KEY:
82 h->ret_value = parm;
83 dlg_stop (h);
84 return MSG_HANDLED;
85 default:
86 return default_dlg_callback (h, sender, msg, parm, data);
90 /*** public functions **************************************************/
92 void
93 editcmd_dialog_replace_show (WEdit * edit, const char *search_default, const char *replace_default,
94 /*@out@ */ char **search_text, /*@out@ */ char **replace_text)
96 if ((search_default == NULL) || (*search_default == '\0'))
97 search_default = INPUT_LAST_TEXT;
100 size_t num_of_types;
101 gchar **list_of_types = mc_search_get_types_strings_array (&num_of_types);
102 int REPLACE_DLG_HEIGHT = REPLACE_DLG_MIN_HEIGHT + num_of_types - REPLACE_DLG_HEIGHT_SUPPLY;
104 QuickWidget quick_widgets[] = {
105 /* 0 */ QUICK_BUTTON (6, 10, 13, REPLACE_DLG_HEIGHT, N_("&Cancel"), B_CANCEL, NULL),
106 /* 1 */ QUICK_BUTTON (2, 10, 13, REPLACE_DLG_HEIGHT, N_("&OK"), B_ENTER, NULL),
107 #ifdef HAVE_CHARSET
108 /* 2 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 11, REPLACE_DLG_HEIGHT,
109 N_("All charsets"),
110 &edit_search_options.all_codepages),
111 #endif
112 /* 3 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 10, REPLACE_DLG_HEIGHT,
113 N_("&Whole words"),
114 &edit_search_options.whole_words),
115 /* 4 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 9, REPLACE_DLG_HEIGHT,
116 N_("In se&lection"),
117 &edit_search_options.only_in_selection),
118 /* 5 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 8, REPLACE_DLG_HEIGHT, N_("&Backwards"),
119 &edit_search_options.backwards),
120 /* 6 */ QUICK_CHECKBOX (33, REPLACE_DLG_WIDTH, 7, REPLACE_DLG_HEIGHT,
121 N_("Case &sensitive"),
122 &edit_search_options.case_sens),
123 /* 7 */ QUICK_RADIO (3, REPLACE_DLG_WIDTH, 7, REPLACE_DLG_HEIGHT,
124 num_of_types, (const char **) list_of_types,
125 (int *) &edit_search_options.type),
126 /* 8 */ QUICK_LABEL (3, REPLACE_DLG_WIDTH, 4, REPLACE_DLG_HEIGHT,
127 N_("Enter replacement string:")),
128 /* 9 */ QUICK_INPUT (3, REPLACE_DLG_WIDTH, 5, REPLACE_DLG_HEIGHT,
129 replace_default, REPLACE_DLG_WIDTH - 6, 0, "replace",
130 replace_text),
131 /* 10 */ QUICK_LABEL (3, REPLACE_DLG_WIDTH, 2, REPLACE_DLG_HEIGHT,
132 N_("Enter search string:")),
133 /* 11 */ QUICK_INPUT (3, REPLACE_DLG_WIDTH, 3, REPLACE_DLG_HEIGHT,
134 search_default, REPLACE_DLG_WIDTH - 6, 0,
135 MC_HISTORY_SHARED_SEARCH, search_text),
136 QUICK_END
139 QuickDialog Quick_input = {
140 REPLACE_DLG_WIDTH, REPLACE_DLG_HEIGHT, -1, -1, N_("Replace"),
141 "[Input Line Keys]", quick_widgets, NULL, FALSE
144 if (quick_dialog (&Quick_input) != B_CANCEL)
146 edit->replace_mode = 0;
148 else
150 *replace_text = NULL;
151 *search_text = NULL;
154 g_strfreev (list_of_types);
158 /* --------------------------------------------------------------------------------------------- */
160 void
161 editcmd_dialog_search_show (WEdit * edit, char **search_text)
163 (void) edit;
165 if (*search_text == NULL)
166 *search_text = INPUT_LAST_TEXT;
169 size_t num_of_types;
170 gchar **list_of_types = mc_search_get_types_strings_array (&num_of_types);
171 int SEARCH_DLG_HEIGHT = SEARCH_DLG_MIN_HEIGHT + num_of_types - SEARCH_DLG_HEIGHT_SUPPLY;
172 size_t i;
174 int dialog_result;
176 QuickWidget quick_widgets[] = {
177 /* 0 */
178 QUICK_BUTTON (6, 10, 11, SEARCH_DLG_HEIGHT, N_("&Cancel"), B_CANCEL, NULL),
179 /* 1 */
180 QUICK_BUTTON (4, 10, 11, SEARCH_DLG_HEIGHT, N_("&Find all"), B_USER, NULL),
181 /* 2 */
182 QUICK_BUTTON (2, 10, 11, SEARCH_DLG_HEIGHT, N_("&OK"), B_ENTER, NULL),
183 #ifdef HAVE_CHARSET
184 /* 3 */
185 QUICK_CHECKBOX (33, SEARCH_DLG_WIDTH, 9, SEARCH_DLG_HEIGHT, N_("All charsets"),
186 &edit_search_options.all_codepages),
187 #endif
188 /* 4 */
189 QUICK_CHECKBOX (33, SEARCH_DLG_WIDTH, 8, SEARCH_DLG_HEIGHT, N_("&Whole words"),
190 &edit_search_options.whole_words),
191 /* 5 */
192 QUICK_CHECKBOX (33, SEARCH_DLG_WIDTH, 7, SEARCH_DLG_HEIGHT, N_("In se&lection"),
193 &edit_search_options.only_in_selection),
194 /* 6 */
195 QUICK_CHECKBOX (33, SEARCH_DLG_WIDTH, 6, SEARCH_DLG_HEIGHT, N_("&Backwards"),
196 &edit_search_options.backwards),
197 /* 7 */
198 QUICK_CHECKBOX (33, SEARCH_DLG_WIDTH, 5, SEARCH_DLG_HEIGHT, N_("Case &sensitive"),
199 &edit_search_options.case_sens),
200 /* 8 */
201 QUICK_RADIO (3, SEARCH_DLG_WIDTH, 5, SEARCH_DLG_HEIGHT,
202 num_of_types, (const char **) list_of_types,
203 (int *) &edit_search_options.type),
204 /* 9 */
205 QUICK_INPUT (3, SEARCH_DLG_WIDTH, 3, SEARCH_DLG_HEIGHT,
206 *search_text, SEARCH_DLG_WIDTH - 6, 0,
207 MC_HISTORY_SHARED_SEARCH, search_text),
208 /* 10 */
209 QUICK_LABEL (3, SEARCH_DLG_WIDTH, 2, SEARCH_DLG_HEIGHT, N_("Enter search string:")),
210 QUICK_END
213 #ifdef HAVE_CHARSET
214 size_t last_checkbox = 7;
215 #else
216 size_t last_checkbox = 6;
217 #endif
219 QuickDialog Quick_input = {
220 SEARCH_DLG_WIDTH, SEARCH_DLG_HEIGHT, -1, -1, N_("Search"),
221 "[Input Line Keys]", quick_widgets, NULL, TRUE
224 #ifdef ENABLE_NLS
225 char **list_of_types_nls;
227 /* header title */
228 Quick_input.title = _(Quick_input.title);
229 /* buttons */
230 for (i = 0; i < 3; i++)
231 quick_widgets[i].u.button.text = _(quick_widgets[i].u.button.text);
232 /* checkboxes */
233 for (i = 3; i <= last_checkbox; i++)
234 quick_widgets[i].u.checkbox.text = _(quick_widgets[i].u.checkbox.text);
235 /* label */
236 quick_widgets[10].u.label.text = _(quick_widgets[10].u.label.text);
238 /* radiobuttons */
239 /* create copy of radio items to avoid memory leak */
240 list_of_types_nls = g_new0 (char *, num_of_types + 1);
241 for (i = 0; i < num_of_types; i++)
242 list_of_types_nls[i] = g_strdup (_(list_of_types[i]));
243 g_strfreev (list_of_types);
244 list_of_types = list_of_types_nls;
245 quick_widgets[last_checkbox + 1].u.radio.items = (const char **) list_of_types;
246 #endif
248 /* calculate widget coordinates */
250 int len = 0;
251 int dlg_width;
252 gchar **radio = list_of_types;
253 int b0_len, b1_len, b2_len;
254 const int button_gap = 2;
256 /* length of radiobuttons */
257 while (*radio != NULL)
259 len = max (len, str_term_width1 (*radio));
260 radio++;
262 /* length of checkboxes */
263 for (i = 3; i <= last_checkbox; i++)
264 len = max (len, str_term_width1 (quick_widgets[i].u.checkbox.text) + 4);
266 /* preliminary dialog width */
267 dlg_width = max (len * 2, str_term_width1 (Quick_input.title)) + 4;
269 /* length of buttons */
270 b0_len = str_term_width1 (quick_widgets[0].u.button.text) + 3;
271 b1_len = str_term_width1 (quick_widgets[1].u.button.text) + 3;
272 b2_len = str_term_width1 (quick_widgets[2].u.button.text) + 5; /* default button */
273 len = b0_len + b1_len + b2_len + button_gap * 2;
275 /* dialog width */
276 Quick_input.xlen = max (SEARCH_DLG_WIDTH, max (dlg_width, len + 6));
278 /* correct widget coordinates */
279 for (i = 0; i < sizeof (quick_widgets) / sizeof (quick_widgets[0]); i++)
280 quick_widgets[i].x_divisions = Quick_input.xlen;
282 /* checkbox positions */
283 for (i = 3; i <= last_checkbox; i++)
284 quick_widgets[i].relative_x = Quick_input.xlen / 2 + 2;
285 /* input length */
286 quick_widgets[last_checkbox + 2].u.input.len = Quick_input.xlen - 6;
287 /* button positions */
288 quick_widgets[2].relative_x = Quick_input.xlen / 2 - len / 2;
289 quick_widgets[1].relative_x = quick_widgets[2].relative_x + b2_len + button_gap;
290 quick_widgets[0].relative_x = quick_widgets[1].relative_x + b1_len + button_gap;
293 dialog_result = quick_dialog (&Quick_input);
295 g_strfreev (list_of_types);
297 if (dialog_result == B_CANCEL)
298 *search_text = NULL;
299 else if (dialog_result == B_USER)
300 search_create_bookmark = 1;
304 /* --------------------------------------------------------------------------------------------- */
306 /* gets a raw key from the keyboard. Passing cancel = 1 draws
307 a cancel button thus allowing c-c etc. Alternatively, cancel = 0
308 will return the next key pressed. ctrl-a (=B_CANCEL), ctrl-g, ctrl-c,
309 and Esc are cannot returned */
312 editcmd_dialog_raw_key_query (const char *heading, const char *query, int cancel)
314 int w = str_term_width1 (query) + 7;
316 struct Dlg_head *raw_dlg =
317 create_dlg (TRUE, 0, 0, 7, w, dialog_colors, editcmd_dialog_raw_key_query_cb,
318 NULL, heading, DLG_CENTER | DLG_TRYUP | DLG_WANT_TAB);
319 add_widget (raw_dlg, input_new (3 - cancel, w - 5, input_get_default_colors(),
320 2, "", 0, INPUT_COMPLETE_DEFAULT));
321 add_widget (raw_dlg, label_new (3 - cancel, 2, query));
322 if (cancel)
323 add_widget (raw_dlg, button_new (4, w / 2 - 5, B_CANCEL, NORMAL_BUTTON, _("Cancel"), 0));
324 w = run_dlg (raw_dlg);
325 destroy_dlg (raw_dlg);
326 if (cancel)
328 if (w == XCTRL ('g') || w == XCTRL ('c') || w == ESC_CHAR || w == B_CANCEL)
329 return 0;
332 return w;
335 /* --------------------------------------------------------------------------------------------- */
337 /* let the user select its preferred completion */
338 void
339 editcmd_dialog_completion_show (WEdit * edit, int max_len, int word_len,
340 struct selection *compl, int num_compl)
343 int start_x, start_y, offset, i;
344 char *curr = NULL;
345 Dlg_head *compl_dlg;
346 WListbox *compl_list;
347 int compl_dlg_h; /* completion dialog height */
348 int compl_dlg_w; /* completion dialog width */
350 /* calculate the dialog metrics */
351 compl_dlg_h = num_compl + 2;
352 compl_dlg_w = max_len + 4;
353 start_x = edit->curs_col + edit->start_col - (compl_dlg_w / 2) +
354 EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
355 start_y = edit->curs_row + EDIT_TEXT_VERTICAL_OFFSET + 1;
357 if (start_x < 0)
358 start_x = 0;
359 if (compl_dlg_w > COLS)
360 compl_dlg_w = COLS;
361 if (compl_dlg_h > LINES - 2)
362 compl_dlg_h = LINES - 2;
364 offset = start_x + compl_dlg_w - COLS;
365 if (offset > 0)
366 start_x -= offset;
367 offset = start_y + compl_dlg_h - LINES;
368 if (offset > 0)
369 start_y -= (offset + 1);
371 /* create the dialog */
372 compl_dlg =
373 create_dlg (TRUE, start_y, start_x, compl_dlg_h, compl_dlg_w,
374 dialog_colors, NULL, "[Completion]", NULL, DLG_COMPACT);
376 /* create the listbox */
377 compl_list = listbox_new (1, 1, compl_dlg_h - 2, compl_dlg_w - 2, FALSE, NULL);
379 /* add the dialog */
380 add_widget (compl_dlg, compl_list);
382 /* fill the listbox with the completions */
383 for (i = num_compl - 1; i >= 0; i--) /* reverse order */
384 listbox_add_item (compl_list, LISTBOX_APPEND_AT_END, 0, (char *) compl[i].text, NULL);
386 /* pop up the dialog and apply the choosen completion */
387 if (run_dlg (compl_dlg) == B_ENTER)
389 listbox_get_current (compl_list, &curr, NULL);
390 if (curr)
392 #ifdef HAVE_CHARSET
393 GString *temp, *temp2;
394 temp = g_string_new ("");
395 for (curr += word_len; *curr; curr++)
396 g_string_append_c (temp, *curr);
398 temp2 = str_convert_to_input (temp->str);
400 if (temp2 && temp2->len)
402 g_string_free (temp, TRUE);
403 temp = temp2;
405 else
406 g_string_free (temp2, TRUE);
407 for (curr = temp->str; *curr; curr++)
408 edit_insert (edit, *curr);
409 g_string_free (temp, TRUE);
410 #else
411 for (curr += word_len; *curr; curr++)
412 edit_insert (edit, *curr);
413 #endif
417 /* destroy dialog before return */
418 destroy_dlg (compl_dlg);
421 /* --------------------------------------------------------------------------------------------- */
423 /* let the user select where function definition */
424 void
425 editcmd_dialog_select_definition_show (WEdit * edit, char *match_expr, int max_len, int word_len,
426 etags_hash_t * def_hash, int num_lines)
429 int start_x, start_y, offset, i;
430 char *curr = NULL;
431 etags_hash_t *curr_def = NULL;
432 Dlg_head *def_dlg;
433 WListbox *def_list;
434 int def_dlg_h; /* dialog height */
435 int def_dlg_w; /* dialog width */
436 char *label_def = NULL;
438 (void) word_len;
439 /* calculate the dialog metrics */
440 def_dlg_h = num_lines + 2;
441 def_dlg_w = max_len + 4;
442 start_x = edit->curs_col + edit->start_col - (def_dlg_w / 2) +
443 EDIT_TEXT_HORIZONTAL_OFFSET + option_line_state_width;
444 start_y = edit->curs_row + EDIT_TEXT_VERTICAL_OFFSET + 1;
446 if (start_x < 0)
447 start_x = 0;
448 if (def_dlg_w > COLS)
449 def_dlg_w = COLS;
450 if (def_dlg_h > LINES - 2)
451 def_dlg_h = LINES - 2;
453 offset = start_x + def_dlg_w - COLS;
454 if (offset > 0)
455 start_x -= offset;
456 offset = start_y + def_dlg_h - LINES;
457 if (offset > 0)
458 start_y -= (offset + 1);
460 /* create the dialog */
461 def_dlg = create_dlg (TRUE, start_y, start_x, def_dlg_h, def_dlg_w,
462 dialog_colors, NULL, "[Definitions]", match_expr, DLG_COMPACT);
464 /* create the listbox */
465 def_list = listbox_new (1, 1, def_dlg_h - 2, def_dlg_w - 2, FALSE, NULL);
467 /* add the dialog */
468 add_widget (def_dlg, def_list);
470 /* fill the listbox with the completions */
471 for (i = 0; i < num_lines; i++)
473 label_def =
474 g_strdup_printf ("%s -> %s:%ld", def_hash[i].short_define, def_hash[i].filename,
475 def_hash[i].line);
476 listbox_add_item (def_list, LISTBOX_APPEND_AT_END, 0, label_def, &def_hash[i]);
477 g_free (label_def);
480 /* pop up the dialog and apply the choosen completion */
481 if (run_dlg (def_dlg) == B_ENTER)
483 char *tmp_curr_def = (char *) curr_def;
484 int do_moveto = 0;
486 listbox_get_current (def_list, &curr, (void **) &tmp_curr_def);
487 curr_def = (etags_hash_t *) tmp_curr_def;
488 if (edit->modified)
490 if (!edit_query_dialog2
491 (_("Warning"),
492 _("Current text was modified without a file save.\n"
493 "Continue discards these changes."), _("C&ontinue"), _("&Cancel")))
495 edit->force |= REDRAW_COMPLETELY;
496 do_moveto = 1;
499 else
501 do_moveto = 1;
504 if (curr && do_moveto)
506 if (edit_stack_iterator + 1 < MAX_HISTORY_MOVETO)
508 g_free (edit_history_moveto[edit_stack_iterator].filename);
509 if (edit->dir)
511 edit_history_moveto[edit_stack_iterator].filename =
512 g_strdup_printf ("%s/%s", edit->dir, edit->filename);
514 else
516 edit_history_moveto[edit_stack_iterator].filename = g_strdup (edit->filename);
518 edit_history_moveto[edit_stack_iterator].line = edit->start_line +
519 edit->curs_row + 1;
520 edit_stack_iterator++;
521 g_free (edit_history_moveto[edit_stack_iterator].filename);
522 edit_history_moveto[edit_stack_iterator].filename =
523 g_strdup ((char *) curr_def->fullpath);
524 edit_history_moveto[edit_stack_iterator].line = curr_def->line;
525 edit_reload_line (edit, edit_history_moveto[edit_stack_iterator].filename,
526 edit_history_moveto[edit_stack_iterator].line);
531 /* clear definition hash */
532 for (i = 0; i < MAX_DEFINITIONS; i++)
534 g_free (def_hash[i].filename);
537 /* destroy dialog before return */
538 destroy_dlg (def_dlg);
541 /* --------------------------------------------------------------------------------------------- */
544 editcmd_dialog_replace_prompt_show (WEdit * edit, char *from_text, char *to_text, int xpos,
545 int ypos)
547 /* dialog sizes */
548 int dlg_height = 9;
549 int dlg_width = 8;
551 int retval;
552 int i;
553 int btn_pos;
555 char *repl_from, *repl_to;
556 char tmp[BUF_MEDIUM];
558 QuickWidget quick_widgets[] = {
559 /* 0 */ QUICK_BUTTON (44, dlg_width, 6, dlg_height, N_("&Cancel"), B_CANCEL, NULL),
560 /* 1 */ QUICK_BUTTON (29, dlg_width, 6, dlg_height, N_("&Skip"), B_SKIP_REPLACE, NULL),
561 /* 2 */ QUICK_BUTTON (21, dlg_width, 6, dlg_height, N_("A&ll"), B_REPLACE_ALL, NULL),
562 /* 3 */ QUICK_BUTTON (4, dlg_width, 6, dlg_height, N_("&Replace"), B_ENTER, NULL),
563 /* 4 */ QUICK_LABEL (3, dlg_width, 2, dlg_height, NULL),
564 /* 5 */ QUICK_LABEL (3, dlg_width, 3, dlg_height, N_("Replace with:")),
565 /* 6 */ QUICK_LABEL (3, dlg_width, 4, dlg_height, NULL),
566 QUICK_END
569 #ifdef ENABLE_NLS
570 for (i = 0; i < 4; i++)
571 quick_widgets[i].u.button.text = _(quick_widgets[i].u.button.text);
572 #endif
574 /* calculate button positions */
575 btn_pos = 4;
577 for (i = 3; i > -1; i--)
579 quick_widgets[i].relative_x = btn_pos;
580 btn_pos += str_term_width1 (quick_widgets[i].u.button.text) + 5;
581 if (i == 3) /* default button */
582 btn_pos += 2;
585 dlg_width = btn_pos + 2;
587 /* correct widget coordinates */
588 for (i = 0; i < 7; i++)
589 quick_widgets[i].x_divisions = dlg_width;
591 g_snprintf (tmp, sizeof (tmp), "\"%s\"", from_text);
592 repl_from = g_strdup (str_fit_to_term (tmp, dlg_width - 7, J_LEFT));
594 g_snprintf (tmp, sizeof (tmp), "\"%s\"", to_text);
595 repl_to = g_strdup (str_fit_to_term (tmp, dlg_width - 7, J_LEFT));
597 quick_widgets[4].u.label.text = repl_from;
598 quick_widgets[6].u.label.text = repl_to;
600 if (xpos == -1)
601 xpos = (edit->num_widget_columns - dlg_width) / 2;
603 if (ypos == -1)
604 ypos = edit->num_widget_lines * 2 / 3;
607 QuickDialog Quick_input = {
608 dlg_width, dlg_height, 0, 0, N_("Confirm replace"),
609 "[Input Line Keys]", quick_widgets, NULL, FALSE
612 /* Sometimes menu can hide replaced text. I don't like it */
613 if ((edit->curs_row >= ypos - 1) && (edit->curs_row <= ypos + dlg_height - 1))
614 ypos -= dlg_height;
616 Quick_input.ypos = ypos;
617 Quick_input.xpos = xpos;
619 retval = quick_dialog (&Quick_input);
620 g_free (repl_from);
621 g_free (repl_to);
623 return retval;
627 /* --------------------------------------------------------------------------------------------- */