-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmc-4.8.4-supertab-short-v3.patch
82 lines (77 loc) · 3.84 KB
/
mc-4.8.4-supertab-short-v3.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff -uNr mc-4.8.6.orig/src/editor/edit.c mc-4.8.6/src/editor/edit.c
--- mc-4.8.6.orig/src/editor/edit.c 2012-09-14 15:03:21.000000000 +0400
+++ mc-4.8.6/src/editor/edit.c 2012-09-17 21:24:33.361781228 +0400
@@ -90,6 +90,7 @@
int option_cursor_beyond_eol = 0;
int option_line_state = 0;
int option_line_state_width = 0;
+int option_supertab = 0;
int option_edit_right_extreme = 0;
int option_edit_left_extreme = 0;
@@ -3922,8 +3923,12 @@
edit_mark_cmd (edit, FALSE);
edit_move_block_to_right (edit);
}
+ //if we are neither at the bol nor after space characters
+ else if (option_supertab && !isspace (edit_get_byte (edit, edit->curs1 - 1)))
+ edit_complete_word_cmd (edit);
else
{
+ck_tab:
if (option_cursor_beyond_eol)
edit_insert_over (edit);
edit_tab_cmd (edit);
@@ -4111,6 +4116,8 @@
/* if text marked shift block */
if (edit->mark1 != edit->mark2 && !option_persistent_selections)
edit_move_block_to_left (edit);
+ else if (option_supertab)
+ goto ck_tab;
else
edit_complete_word_cmd (edit);
break;
diff -uNr mc-4.8.6.orig/src/editor/edit.h mc-4.8.6/src/editor/edit.h
--- mc-4.8.6.orig/src/editor/edit.h 2012-09-11 12:02:20.000000000 +0400
+++ mc-4.8.6/src/editor/edit.h 2012-09-17 21:23:06.318420060 +0400
@@ -45,6 +45,7 @@
extern int option_save_position;
extern int option_syntax_highlighting;
extern int option_group_undo;
+extern int option_supertab;
extern char *option_backup_ext;
extern int edit_confirm_save;
diff -uNr mc-4.8.6.orig/src/editor/editoptions.c mc-4.8.6/src/editor/editoptions.c
--- mc-4.8.6.orig/src/editor/editoptions.c 2012-09-14 15:03:21.000000000 +0400
+++ mc-4.8.6/src/editor/editoptions.c 2012-09-17 21:23:06.318420060 +0400
@@ -46,7 +46,7 @@
/*** file scope macro definitions ****************************************************************/
-#define OPT_DLG_H 17
+#define OPT_DLG_H 18
#define OPT_DLG_W 74
/*** file scope type declarations ****************************************************************/
@@ -127,10 +127,12 @@
QuickWidget quick_widgets[] = {
/* 0 */ QUICK_BUTTON (6, 10, OPT_DLG_H - 3, OPT_DLG_H, N_("&Cancel"), B_CANCEL, NULL),
/* 1 */ QUICK_BUTTON (2, 10, OPT_DLG_H - 3, OPT_DLG_H, N_("&OK"), B_ENTER, NULL),
- /* 2 */ QUICK_LABEL (OPT_DLG_W / 2 + 1, OPT_DLG_W, 12, OPT_DLG_H,
+ /* 2 */ QUICK_LABEL (OPT_DLG_W / 2 + 1, OPT_DLG_W, 13, OPT_DLG_H,
N_("Word wrap line length:")),
- /* 3 */ QUICK_INPUT (OPT_DLG_W / 2 + 25, OPT_DLG_W, 12, OPT_DLG_H,
+ /* 3 */ QUICK_INPUT (OPT_DLG_W / 2 + 25, OPT_DLG_W, 13, OPT_DLG_H,
wrap_length, OPT_DLG_W / 2 - 4 - 24, 0, "edit-word-wrap", &p),
+ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 12, OPT_DLG_H,
+ N_("&Tab completion"), &option_supertab),
/* 4 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 11, OPT_DLG_H,
N_("&Group undo"), &option_group_undo),
/* 5 */ QUICK_CHECKBOX (OPT_DLG_W / 2 + 1, OPT_DLG_W, 10, OPT_DLG_H,
diff -uNr mc-4.8.6.orig/src/setup.c mc-4.8.6/src/setup.c
--- mc-4.8.6.orig/src/setup.c 2012-09-11 12:19:20.000000000 +0400
+++ mc-4.8.6/src/setup.c 2012-09-17 21:23:06.318420060 +0400
@@ -307,6 +307,7 @@
{ "editor_option_save_position", &option_save_position },
{ "editor_option_auto_para_formatting", &option_auto_para_formatting },
{ "editor_option_typewriter_wrap", &option_typewriter_wrap },
+ { "editor_option_supertab", &option_supertab },
{ "editor_edit_confirm_save", &edit_confirm_save },
{ "editor_syntax_highlighting", &option_syntax_highlighting },
{ "editor_persistent_selections", &option_persistent_selections },