2 Editor initialisation and callback handler.
4 Copyright (C) 1996, 1997, 1998, 2001, 2002, 2003, 2004, 2005, 2006,
6 The Free Software Foundation, Inc.
11 This file is part of the Midnight Commander.
13 The Midnight Commander is free software: you can redistribute it
14 and/or modify it under the terms of the GNU General Public License as
15 published by the Free Software Foundation, either version 3 of the License,
16 or (at your option) any later version.
18 The Midnight Commander is distributed in the hope that it will be useful,
19 but WITHOUT ANY WARRANTY; without even the implied warranty of
20 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 GNU General Public License for more details.
23 You should have received a copy of the GNU General Public License
24 along with this program. If not, see <http://www.gnu.org/licenses/>.
28 * \brief Source: editor initialisation and callback handler
37 #include <sys/types.h>
45 #include "lib/global.h"
47 #include "lib/tty/tty.h" /* LINES, COLS */
48 #include "lib/tty/key.h" /* is_idle() */
49 #include "lib/tty/color.h" /* tty_setcolor() */
50 #include "lib/skin.h" /* EDITOR_NORMAL_COLOR */
51 #include "lib/strutil.h" /* str_term_trim() */
52 #include "lib/util.h" /* mc_build_filename() */
53 #include "lib/widget.h"
54 #include "lib/mcconfig.h"
55 #include "lib/event.h" /* mc_event_raise() */
57 #include "src/keybind-defaults.h"
58 #include "src/main.h" /* home_dir */
59 #include "src/filemanager/cmd.h" /* view_other_cmd(), save_setup_cmd() */
60 #include "src/learn.h" /* learn_keys() */
62 #include "edit-impl.h"
63 #include "editwidget.h"
65 /*** global variables ****************************************************************************/
67 /*** file scope macro definitions ****************************************************************/
69 #define WINDOW_MIN_LINES (2 + 2)
70 #define WINDOW_MIN_COLS (2 + LINE_STATE_WIDTH)
72 /*** file scope type declarations ****************************************************************/
74 /*** file scope variables ************************************************************************/
76 /*** file scope functions ************************************************************************/
78 static cb_ret_t
edit_callback (Widget
* w
, widget_msg_t msg
, int parm
);
80 /* --------------------------------------------------------------------------------------------- */
82 * Show info about editor
88 const char *header
= N_("About");
89 const char *button_name
= N_("&OK");
90 const char *const version
= "MCEdit " VERSION
;
93 int win_len
, version_len
, button_len
;
100 button_name
= _(button_name
);
103 button_len
= str_term_width1 (button_name
) + 5;
104 version_len
= str_term_width1 (version
);
106 g_snprintf (text
, sizeof (text
),
107 _("Copyright (C) 1996-2012 the Free Software Foundation\n\n"
108 " A user friendly text editor\n"
109 " written for the Midnight Commander"));
111 win_len
= str_term_width1 (header
);
112 win_len
= max (win_len
, version_len
);
113 win_len
= max (win_len
, button_len
);
115 /* count width and height of text */
116 str_msg_term_size (text
, &lines
, &cols
);
118 cols
= max (win_len
, cols
) + 6;
121 about_dlg
= create_dlg (TRUE
, 0, 0, lines
, cols
, dialog_colors
, NULL
, NULL
,
122 "[Internal File Editor]", header
, DLG_CENTER
| DLG_TRYUP
);
124 add_widget (about_dlg
, label_new (3, (cols
- version_len
) / 2, version
));
125 add_widget (about_dlg
, label_new (5, 3, text
));
126 add_widget (about_dlg
, button_new (lines
- 3, (cols
- button_len
) / 2,
127 B_ENTER
, NORMAL_BUTTON
, button_name
, NULL
));
130 destroy_dlg (about_dlg
);
133 /* --------------------------------------------------------------------------------------------- */
141 ev_help_t event_data
= { NULL
, "[Internal File Editor]" };
142 mc_event_raise (MCEVENT_GROUP_CORE
, "help", &event_data
);
145 /* --------------------------------------------------------------------------------------------- */
147 * Restore saved window size.
149 * @param edit editor object
153 edit_restore_size (WEdit
* edit
)
155 edit
->drag_state
= MCEDIT_DRAG_NORMAL
;
156 widget_set_size ((Widget
*) edit
, edit
->y_prev
, edit
->x_prev
,
157 edit
->lines_prev
, edit
->cols_prev
);
158 dlg_redraw (((Widget
*) edit
)->owner
);
161 /* --------------------------------------------------------------------------------------------- */
163 * Move window by one row or column in any direction.
165 * @param edit editor object
166 * @param command direction (CK_Up, CK_Down, CK_Left, CK_Right)
170 edit_window_move (WEdit
* edit
, unsigned long command
)
172 Widget
*w
= (Widget
*) edit
;
173 Dlg_head
*h
= w
->owner
;
178 if (w
->y
> h
->y
+ 1) /* menubar */
182 if (w
->y
< h
->y
+ h
->lines
- 2) /* buttonbar */
186 if (w
->x
+ w
->cols
> h
->x
)
190 if (w
->x
< h
->x
+ h
->cols
)
197 edit
->force
|= REDRAW_PAGE
;
201 /* --------------------------------------------------------------------------------------------- */
203 * Resize window by one row or column in any direction.
205 * @param edit editor object
206 * @param command direction (CK_Up, CK_Down, CK_Left, CK_Right)
210 edit_window_resize (WEdit
* edit
, unsigned long command
)
212 Widget
*w
= (Widget
*) edit
;
213 Dlg_head
*h
= w
->owner
;
218 if (w
->lines
> WINDOW_MIN_LINES
)
222 if (w
->y
+ w
->lines
< h
->y
+ h
->lines
- 1) /* buttonbar */
226 if (w
->cols
> WINDOW_MIN_COLS
)
230 if (w
->x
+ w
->cols
< h
->x
+ h
->cols
)
237 edit
->force
|= REDRAW_COMPLETELY
;
241 /* --------------------------------------------------------------------------------------------- */
244 edit_get_shortcut (unsigned long command
)
247 const char *shortcut
= NULL
;
249 shortcut
= keybind_lookup_keymap_shortcut (editor_map
, command
);
250 if (shortcut
!= NULL
)
251 return g_strdup (shortcut
);
253 ext_map
= keybind_lookup_keymap_shortcut (editor_map
, CK_ExtendedKeyMap
);
255 shortcut
= keybind_lookup_keymap_shortcut (editor_x_map
, command
);
256 if (shortcut
!= NULL
)
257 return g_strdup_printf ("%s %s", ext_map
, shortcut
);
262 /* --------------------------------------------------------------------------------------------- */
265 edit_get_title (const Dlg_head
* h
, size_t len
)
267 const WEdit
*edit
= find_editor (h
);
268 const char *modified
= edit
->modified
? "(*) " : " ";
269 const char *file_label
;
274 filename
= vfs_path_to_str (edit
->filename_vpath
);
275 file_label
= str_term_trim (filename
, len
- str_term_width1 (_("Edit: ")));
278 return g_strconcat (_("Edit: "), modified
, file_label
, (char *) NULL
);
281 /* --------------------------------------------------------------------------------------------- */
284 edit_event (Gpm_Event
* event
, void *data
)
286 WEdit
*edit
= (WEdit
*) data
;
287 Widget
*w
= (Widget
*) data
;
290 if (!mouse_global_in_widget (event
, w
))
291 return MOU_UNHANDLED
;
293 local
= mouse_get_local (event
, w
);
295 /* Unknown event type */
296 if ((event
->type
& (GPM_DOWN
| GPM_DRAG
| GPM_UP
)) == 0)
299 edit_update_curs_row (edit
);
300 edit_update_curs_col (edit
);
302 if (!EDIT_WITH_FRAME
|| (local
.buttons
& GPM_B_LEFT
) == 0 || (local
.type
& GPM_UP
) != 0)
303 edit
->drag_state
= MCEDIT_DRAG_NORMAL
;
304 else if (local
.y
== 1 && edit
->drag_state
!= MCEDIT_DRAG_RESIZE
)
306 /* click on the top line (move) */
308 /* start move; save x coordinate of mouse */
309 if ((local
.type
& GPM_DOWN
) != 0)
310 edit
->drag_state_start
= local
.x
;
313 if ((local
.type
& (GPM_DOWN
| GPM_DRAG
)) != 0)
314 edit
->drag_state
= MCEDIT_DRAG_MOVE
;
316 else if (local
.y
== w
->lines
&& local
.x
== w
->cols
)
318 /* click on bottom-right corner (resize) */
319 if ((local
.type
& (GPM_DOWN
| GPM_DRAG
)) != 0)
320 edit
->drag_state
= MCEDIT_DRAG_RESIZE
;
323 if (edit
->drag_state
== MCEDIT_DRAG_NORMAL
)
325 gboolean done
= TRUE
;
328 if ((local
.type
& (GPM_DOUBLE
| GPM_UP
)) == (GPM_UP
| GPM_DOUBLE
))
330 edit_mark_current_word_cmd (edit
);
335 if ((local
.type
& (GPM_TRIPLE
| GPM_UP
)) == (GPM_UP
| GPM_TRIPLE
))
337 edit_mark_current_line_cmd (edit
);
342 if ((local
.buttons
& GPM_B_UP
) != 0 && (local
.type
& GPM_DOWN
) != 0)
344 edit_move_up (edit
, 2, 1);
347 if ((local
.buttons
& GPM_B_DOWN
) != 0 && (local
.type
& GPM_DOWN
) != 0)
349 edit_move_down (edit
, 2, 1);
353 /* continue handle current event */
356 /* handle DRAG mouse event, don't use standard way to continue
357 * event handling outside of widget */
362 c
= tty_get_event (event
, FALSE
, TRUE
);
363 if (c
== EV_NONE
|| c
!= EV_MOUSE
)
366 local
= mouse_get_local (event
, w
);
369 /* A lone up mustn't do anything */
370 if (edit
->mark2
!= -1 && (local
.type
& (GPM_UP
| GPM_DRAG
)) != 0)
373 if ((local
.type
& (GPM_DOWN
| GPM_UP
)) != 0)
374 edit_push_key_press (edit
);
377 if (!option_cursor_beyond_eol
)
378 edit
->prev_col
= local
.x
- edit
->start_col
- option_line_state_width
- 1;
381 long line_len
= edit_move_forward3 (edit
, edit_bol (edit
, edit
->curs1
), 0,
382 edit_eol (edit
, edit
->curs1
));
384 if (local
.x
> line_len
)
387 local
.x
- line_len
- edit
->start_col
- option_line_state_width
- 1;
388 edit
->prev_col
= line_len
;
393 edit
->prev_col
= local
.x
- option_line_state_width
- edit
->start_col
- 1;
399 if (local
.y
> (edit
->curs_row
+ 1))
400 edit_move_down (edit
, local
.y
- (edit
->curs_row
+ 1), 0);
401 else if (local
.y
< (edit
->curs_row
+ 1))
402 edit_move_up (edit
, (edit
->curs_row
+ 1) - local
.y
, 0);
404 edit_move_to_prev_col (edit
, edit_bol (edit
, edit
->curs1
));
406 if ((local
.type
& GPM_DOWN
) != 0)
408 edit_mark_cmd (edit
, 1); /* reset */
412 done
= (local
.type
& GPM_DRAG
) == 0;
414 edit_mark_cmd (edit
, 0);
417 edit_find_bracket (edit
);
418 edit
->force
|= REDRAW_COMPLETELY
;
419 edit_update_curs_row (edit
);
420 edit_update_curs_col (edit
);
421 edit_update_screen (edit
);
423 while (EDIT_WITH_FRAME
&& !done
);
426 while (edit
->drag_state
!= MCEDIT_DRAG_NORMAL
)
430 c
= tty_get_event (event
, FALSE
, TRUE
);
432 if (c
== EV_NONE
|| c
!= EV_MOUSE
)
435 edit
->drag_state
= MCEDIT_DRAG_NORMAL
;
436 edit
->force
|= REDRAW_COMPLETELY
;
437 edit_update_screen (edit
);
441 Dlg_head
*h
= w
->owner
;
443 if (edit
->drag_state
== MCEDIT_DRAG_MOVE
)
445 int y
= event
->y
- 1;
446 int x
= event
->x
- 1;
448 y
= max (y
, h
->y
+ 1); /* status line */
449 y
= min (y
, h
->y
+ h
->lines
- 2); /* buttonbar */
451 x
= min (x
, h
->x
+ h
->cols
- 1);
452 /* don't use widget_set_size() here to avoid double draw */
454 w
->x
= x
- edit
->drag_state_start
;
455 edit
->force
|= REDRAW_PAGE
;
457 else if (edit
->drag_state
== MCEDIT_DRAG_RESIZE
)
459 event
->y
= min (event
->y
, h
->y
+ h
->lines
- 1); /* buttonbar */
460 event
->x
= min (event
->x
, h
->x
+ h
->cols
);
461 local
= mouse_get_local (event
, w
);
463 /* don't use widget_set_size() here to avoid double draw */
464 w
->lines
= max (WINDOW_MIN_LINES
, local
.y
);
465 w
->cols
= max (WINDOW_MIN_COLS
, local
.x
);
466 edit
->force
|= REDRAW_COMPLETELY
;
476 /* --------------------------------------------------------------------------------------------- */
479 edit_dialog_command_execute (Dlg_head
* h
, unsigned long command
)
481 gboolean ret
= MSG_HANDLED
;
486 /* if there are no opened files anymore, close MC editor */
487 if (edit_widget_is_editor ((Widget
*) h
->current
->data
) &&
488 edit_close_cmd ((WEdit
*) h
->current
->data
) && find_editor (h
) == NULL
)
493 /* edit->force |= REDRAW_COMPLETELY; */
501 Widget
*w
= (Widget
*) h
->current
->data
;
503 if (!edit_widget_is_editor (w
) || ((WEdit
*) w
)->drag_state
== MCEDIT_DRAG_NORMAL
)
506 edit_restore_size ((WEdit
*) w
);
519 case CK_WindowResize
:
520 if (edit_widget_is_editor ((Widget
*) h
->current
->data
))
521 edit_handle_move_resize ((WEdit
*) h
->current
->data
, command
);
523 case CK_OptionsSaveMode
:
524 edit_save_mode_cmd ();
530 ret
= MSG_NOT_HANDLED
;
537 /* --------------------------------------------------------------------------------------------- */
540 edit_set_buttonbar (WEdit
* edit
, WButtonBar
* bb
)
542 buttonbar_set_label (bb
, 1, Q_ ("ButtonBar|Help"), editor_map
, NULL
);
543 buttonbar_set_label (bb
, 2, Q_ ("ButtonBar|Save"), editor_map
, (Widget
*) edit
);
544 buttonbar_set_label (bb
, 3, Q_ ("ButtonBar|Mark"), editor_map
, (Widget
*) edit
);
545 buttonbar_set_label (bb
, 4, Q_ ("ButtonBar|Replac"), editor_map
, (Widget
*) edit
);
546 buttonbar_set_label (bb
, 5, Q_ ("ButtonBar|Copy"), editor_map
, (Widget
*) edit
);
547 buttonbar_set_label (bb
, 6, Q_ ("ButtonBar|Move"), editor_map
, (Widget
*) edit
);
548 buttonbar_set_label (bb
, 7, Q_ ("ButtonBar|Search"), editor_map
, (Widget
*) edit
);
549 buttonbar_set_label (bb
, 8, Q_ ("ButtonBar|Delete"), editor_map
, (Widget
*) edit
);
550 buttonbar_set_label (bb
, 9, Q_ ("ButtonBar|PullDn"), editor_map
, NULL
);
551 buttonbar_set_label (bb
, 10, Q_ ("ButtonBar|Quit"), editor_map
, NULL
);
554 /* --------------------------------------------------------------------------------------------- */
555 /** Callback for the edit dialog */
558 edit_dialog_callback (Dlg_head
* h
, Widget
* sender
, dlg_msg_t msg
, int parm
, void *data
)
562 WButtonBar
*buttonbar
;
564 menubar
= find_menubar (h
);
565 buttonbar
= find_buttonbar (h
);
570 edit
= find_editor (h
);
571 edit_set_buttonbar (edit
, buttonbar
);
575 /* don't use common_dialog_repaint() -- we don't need a frame */
576 tty_setcolor (EDITOR_NORMAL_COLOR
);
581 /* dlg_set_size() is surplus for this case */
584 widget_set_size (&buttonbar
->widget
, h
->lines
- 1, h
->x
, 1, h
->cols
);
585 widget_set_size (&menubar
->widget
, h
->y
, h
->x
, 1, h
->cols
);
586 menubar_arrange (menubar
);
592 return edit_dialog_command_execute (h
, parm
);
593 /* message from menu */
594 if (sender
== (Widget
*) menubar
)
596 if (edit_dialog_command_execute (h
, parm
) == MSG_HANDLED
)
598 /* try send command to the current window */
599 return send_message ((Widget
*) h
->current
->data
, WIDGET_COMMAND
, parm
);
601 /* message from buttonbar */
602 if (sender
== (Widget
*) buttonbar
)
605 return send_message ((Widget
*) data
, WIDGET_COMMAND
, parm
);
606 return edit_dialog_command_execute (h
, parm
);
608 return MSG_NOT_HANDLED
;
612 Widget
*w
= h
->current
->data
;
613 cb_ret_t ret
= MSG_NOT_HANDLED
;
615 if (edit_widget_is_editor (w
))
617 WEdit
*e
= (WEdit
*) w
;
618 unsigned long command
;
621 command
= keybind_lookup_keymap_command (editor_map
, parm
);
625 command
= keybind_lookup_keymap_command (editor_x_map
, parm
);
628 if (command
!= CK_IgnoreKey
)
629 ret
= edit_dialog_command_execute (h
, command
);
635 /* hardcoded menu hotkeys (see edit_drop_hotkey_menu) */
636 case DLG_UNHANDLED_KEY
:
637 return edit_drop_hotkey_menu (h
, parm
) ? MSG_HANDLED
: MSG_NOT_HANDLED
;
640 h
->state
= DLG_ACTIVE
; /* don't stop the dialog before final decision */
641 edit
= find_editor (h
);
643 h
->state
= DLG_CLOSED
;
644 else if (edit
->drag_state
!= MCEDIT_DRAG_NORMAL
)
645 edit_restore_size (edit
);
646 else if (edit_ok_to_exit (edit
))
647 h
->state
= DLG_CLOSED
;
651 return default_dlg_callback (h
, sender
, msg
, parm
, data
);
655 /* --------------------------------------------------------------------------------------------- */
658 edit_callback (Widget
* w
, widget_msg_t msg
, int parm
)
660 WEdit
*e
= (WEdit
*) w
;
665 e
->force
|= REDRAW_COMPLETELY
;
669 edit_update_screen (e
);
675 cb_ret_t ret
= MSG_NOT_HANDLED
;
677 /* The user may override the access-keys for the menu bar. */
678 if (macro_index
== -1 && edit_execute_macro (e
, parm
))
680 edit_update_screen (e
);
683 else if (edit_translate_key (e
, parm
, &cmd
, &ch
))
685 edit_execute_key_command (e
, cmd
, ch
);
686 edit_update_screen (e
);
694 /* command from menubar or buttonbar */
695 edit_execute_key_command (e
, parm
, -1);
696 edit_update_screen (e
);
700 widget_move (w
, e
->curs_row
+ EDIT_TEXT_VERTICAL_OFFSET
+ EDIT_WITH_FRAME
,
701 e
->curs_col
+ e
->start_col
+ e
->over_col
+
702 EDIT_TEXT_HORIZONTAL_OFFSET
+ EDIT_WITH_FRAME
+ option_line_state_width
);
710 return default_proc (msg
, parm
);
714 /* --------------------------------------------------------------------------------------------- */
715 /*** public functions ****************************************************************************/
716 /* --------------------------------------------------------------------------------------------- */
719 edit_file (const vfs_path_t
* _file_vpath
, int line
)
721 static gboolean made_directory
= FALSE
;
730 dir
= mc_build_filename (mc_config_get_cache_path (), EDIT_DIR
, NULL
);
731 made_directory
= (mkdir (dir
, 0700) != -1 || errno
== EEXIST
);
734 dir
= mc_build_filename (mc_config_get_path (), EDIT_DIR
, NULL
);
735 made_directory
= (mkdir (dir
, 0700) != -1 || errno
== EEXIST
);
738 dir
= mc_build_filename (mc_config_get_data_path (), EDIT_DIR
, NULL
);
739 made_directory
= (mkdir (dir
, 0700) != -1 || errno
== EEXIST
);
743 wedit
= edit_init (NULL
, 1, 0, LINES
- 2, COLS
, _file_vpath
, line
);
748 /* Create a new dialog and add it widgets to it */
750 create_dlg (FALSE
, 0, 0, LINES
, COLS
, NULL
, edit_dialog_callback
, NULL
,
751 "[Internal File Editor]", NULL
, DLG_WANT_TAB
);
753 edit_dlg
->get_shortcut
= edit_get_shortcut
;
754 edit_dlg
->get_title
= edit_get_title
;
756 menubar
= menubar_new (0, 0, COLS
, NULL
);
757 add_widget (edit_dlg
, menubar
);
758 edit_init_menu (menubar
);
760 init_widget (&wedit
->widget
, wedit
->widget
.y
, wedit
->widget
.x
,
761 wedit
->widget
.lines
, wedit
->widget
.cols
, edit_callback
, edit_event
);
762 widget_want_cursor (wedit
->widget
, TRUE
);
764 add_widget (edit_dlg
, wedit
);
766 add_widget (edit_dlg
, buttonbar_new (TRUE
));
770 if (edit_dlg
->state
== DLG_CLOSED
)
771 destroy_dlg (edit_dlg
);
776 /* --------------------------------------------------------------------------------------------- */
779 edit_get_file_name (const WEdit
* edit
)
781 return vfs_path_to_str (edit
->filename_vpath
);
784 /* --------------------------------------------------------------------------------------------- */
786 * Check if widget is an WEdit class.
788 * @param w probably editor object
789 * @return TRUE if widget is an WEdit class, FALSE otherwise
793 find_editor (const Dlg_head
* h
)
795 return (WEdit
*) find_widget_type (h
, edit_callback
);
798 /* --------------------------------------------------------------------------------------------- */
801 edit_widget_is_editor (const Widget
* w
)
803 return (w
!= NULL
&& w
->callback
== edit_callback
);
806 /* --------------------------------------------------------------------------------------------- */
809 edit_update_screen (WEdit
* e
)
811 edit_scroll_screen_over_cursor (e
);
812 edit_update_curs_col (e
);
814 if (!EDIT_WITH_FRAME
)
818 if ((e
->force
& REDRAW_COMPLETELY
) != 0)
820 /* draw a frame around edit area */
821 tty_setcolor (EDITOR_NORMAL_COLOR
);
822 tty_draw_box (e
->widget
.y
, e
->widget
.x
, e
->widget
.lines
, e
->widget
.cols
, TRUE
);
825 edit_info_status (e
);
828 /* pop all events for this window for internal handling */
830 e
->force
|= REDRAW_PAGE
;
833 if (e
->force
& REDRAW_COMPLETELY
)
834 e
->force
|= REDRAW_PAGE
;
835 edit_render_keypress (e
);
839 /* --------------------------------------------------------------------------------------------- */
841 * Save current window size.
843 * @param edit editor object
847 edit_save_size (WEdit
* edit
)
849 edit
->y_prev
= edit
->widget
.y
;
850 edit
->x_prev
= edit
->widget
.x
;
851 edit
->lines_prev
= edit
->widget
.lines
;
852 edit
->cols_prev
= edit
->widget
.cols
;
855 /* --------------------------------------------------------------------------------------------- */
857 * Handle move/resize events.
859 * @param edit editor object
860 * @param command action id
861 * @return TRUE if mouse actions was handled, FALSE otherwise
865 edit_handle_move_resize (WEdit
* edit
, unsigned long command
)
867 gboolean ret
= FALSE
;
869 switch (edit
->drag_state
)
871 case MCEDIT_DRAG_NORMAL
:
872 /* possible start move/resize */
876 edit
->drag_state
= MCEDIT_DRAG_MOVE
;
877 edit_save_size (edit
);
880 case CK_WindowResize
:
881 edit
->drag_state
= MCEDIT_DRAG_RESIZE
;
882 edit_save_size (edit
);
890 case MCEDIT_DRAG_MOVE
:
893 case CK_WindowResize
:
894 edit
->drag_state
= MCEDIT_DRAG_RESIZE
;
901 edit_window_move (edit
, command
);
906 edit
->drag_state
= MCEDIT_DRAG_NORMAL
;
913 case MCEDIT_DRAG_RESIZE
:
917 edit
->drag_state
= MCEDIT_DRAG_MOVE
;
924 edit_window_resize (edit
, command
);
928 case CK_WindowResize
:
929 edit
->drag_state
= MCEDIT_DRAG_NORMAL
;
940 /* --------------------------------------------------------------------------------------------- */