Ticket #1384: 6.patch
File 6.patch, 7.4 KB (added by vda, 16 years ago) |
---|
-
edit/editdraw.c
diff -d -urpN mc.5/edit/editdraw.c mc.6/edit/editdraw.c
old new edit_draw_this_line (WEdit *edit, long b 442 442 case '\t': 443 443 i = TAB_SIZE - ((int) col % TAB_SIZE); 444 444 col += i; 445 if (use_colors && visible_tabs) {445 if (use_colors && (visible_tabs || (visible_tws && q >= tws))) { 446 446 if (p->style & MOD_MARKED) 447 447 c = (p->style); 448 448 else -
edit/editoptions.c
diff -d -urpN mc.5/edit/editoptions.c mc.6/edit/editoptions.c
old new 38 38 #include "../src/dialog.h" /* B_CANCEL */ 39 39 #include "../src/wtools.h" /* QuickDialog */ 40 40 41 #define OPT_DLG_H 1941 #define OPT_DLG_H 21 42 42 #define OPT_DLG_W 72 43 43 44 44 static const char *key_emu_str[] = … … edit_options_dialog (void) 67 67 int toption_save_position = option_save_position; 68 68 int tedit_confirm_save = edit_confirm_save; 69 69 int tedit_syntax_highlighting = option_syntax_highlighting; 70 int tedit_visible_tabs = visible_tabs; 71 int tedit_visible_tws = visible_tws; 70 72 int tedit_persistent_selections = option_persistent_selections; 71 73 int toption_return_does_auto_indent = option_return_does_auto_indent; 72 74 int toption_backspace_through_tabs = option_backspace_through_tabs; … … edit_options_dialog (void) 81 83 {quick_button, 2, 10, OPT_DLG_H - 3, OPT_DLG_H, N_("&OK"), 0, 82 84 B_ENTER, 0, 0, NULL, NULL, NULL}, 83 85 /* 2 */ 84 {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 7, OPT_DLG_H,86 {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 6, OPT_DLG_H, 85 87 N_("Word wrap line length: "), 0, 0, 0, 0, NULL, NULL, NULL}, 86 88 /* 3 */ 87 {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 7,89 {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 6, 88 90 OPT_DLG_H, "", OPT_DLG_W / 2 - 4 - 24, 0, 0, 0, "edit-word-wrap", NULL, NULL}, 89 91 /* 4 */ 90 {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 6, OPT_DLG_H,92 {quick_label, OPT_DLG_W / 2, OPT_DLG_W, OPT_DLG_H - 7, OPT_DLG_H, 91 93 N_("Tab spacing: "), 0, 0, 0, 0, NULL, NULL, NULL}, 92 94 /* 5 */ 93 {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 6,95 {quick_input, OPT_DLG_W / 2 + 24, OPT_DLG_W, OPT_DLG_H - 7, 94 96 OPT_DLG_H, "", OPT_DLG_W / 2 - 4 - 24, 0, 0, 0, 95 97 "edit-tab-spacing", NULL, NULL}, 96 98 /* 6 */ … … edit_options_dialog (void) 99 101 /* 7 */ 100 102 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 10, 101 103 OPT_DLG_H, N_("Synta&x highlighting"), 8, 0, 0, 0, NULL, NULL, NULL}, 102 /* 7*/104 /* 8 */ 103 105 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 11, 104 OPT_DLG_H, N_(" Save file &position"), 0, 0, 0, 0, NULL, NULL, NULL},106 OPT_DLG_H, N_("Visible tabs"), 8, 0, 0, 0, NULL, NULL, NULL}, 105 107 /* 9 */ 106 108 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 12, 107 OPT_DLG_H, N_(" Confir&m before saving"), 6, 0, 0, 0, NULL, NULL, NULL},109 OPT_DLG_H, N_("Visible trailing spaces"), 8, 0, 0, 0, NULL, NULL, NULL}, 108 110 /* 10 */ 109 111 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 13, 110 OPT_DLG_H, N_(" Fill tabs with &spaces"), 0, 0, 0, 0, NULL, NULL, NULL},112 OPT_DLG_H, N_("Save file &position"), 0, 0, 0, 0, NULL, NULL, NULL}, 111 113 /* 11 */ 112 114 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 14, 113 OPT_DLG_H, N_(" &Return does autoindent"), 0, 0, 0, 0, NULL, NULL, NULL},115 OPT_DLG_H, N_("Confir&m before saving"), 6, 0, 0, 0, NULL, NULL, NULL}, 114 116 /* 12 */ 115 117 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 15, 116 OPT_DLG_H, N_(" &Backspace through tabs"), 0, 0, 0, 0, NULL, NULL, NULL},118 OPT_DLG_H, N_("Fill tabs with &spaces"), 0, 0, 0, 0, NULL, NULL, NULL}, 117 119 /* 13 */ 118 120 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 16, 119 OPT_DLG_H, N_("& Fake half tabs"), 0, 0, 0, 0, NULL, NULL, NULL},121 OPT_DLG_H, N_("&Return does autoindent"), 0, 0, 0, 0, NULL, NULL, NULL}, 120 122 /* 14 */ 121 {quick_ radio, 5, OPT_DLG_W, OPT_DLG_H - 9, OPT_DLG_H, "", 3, 0, 0,122 const_cast(char **, wrap_str), "wrapm", NULL, NULL},123 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 17, 124 OPT_DLG_H, N_("&Backspace through tabs"), 0, 0, 0, 0, NULL, NULL, NULL}, 123 125 /* 15 */ 124 {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 10, OPT_DLG_H, 125 N_("Wrap mode"), 0, 0, 126 0, 0, NULL, NULL, NULL}, 126 {quick_checkbox, OPT_DLG_W / 2 + 1, OPT_DLG_W, OPT_DLG_H - 18, 127 OPT_DLG_H, N_("&Fake half tabs"), 0, 0, 0, 0, NULL, NULL, NULL}, 127 128 /* 16 */ 128 {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 1 5, OPT_DLG_H, "", 3, 0, 0,129 const_cast(char **, key_emu_str), "keyemu", NULL, NULL},129 {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 11, OPT_DLG_H, "", 3, 0, 0, 130 const_cast(char **, wrap_str), "wrapm", NULL, NULL}, 130 131 /* 17 */ 131 {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 16, OPT_DLG_H, 132 {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 12, OPT_DLG_H, 133 N_("Wrap mode"), 0, 0, 0, 0, NULL, NULL, NULL}, 134 /* 18 */ 135 {quick_radio, 5, OPT_DLG_W, OPT_DLG_H - 17, OPT_DLG_H, "", 3, 0, 0, 136 const_cast(char **, key_emu_str), "keyemu", NULL, NULL}, 137 /* 19 */ 138 {quick_label, 4, OPT_DLG_W, OPT_DLG_H - 18, OPT_DLG_H, 132 139 N_("Key emulation"), 0, 0, 0, 0, NULL, NULL, NULL}, 133 140 NULL_QuickWidget 134 141 }; … … edit_options_dialog (void) 153 160 quick_widgets[5].str_result = &q; 154 161 quick_widgets[6].result = &tedit_persistent_selections; 155 162 quick_widgets[7].result = &tedit_syntax_highlighting; 156 quick_widgets[8].result = &toption_save_position; 157 quick_widgets[9].result = &tedit_confirm_save; 158 quick_widgets[10].result = &toption_fill_tabs_with_spaces; 159 quick_widgets[11].result = &toption_return_does_auto_indent; 160 quick_widgets[12].result = &toption_backspace_through_tabs; 161 quick_widgets[13].result = &toption_fake_half_tabs; 163 quick_widgets[8].result = &tedit_visible_tabs; 164 quick_widgets[9].result = &tedit_visible_tws; 165 quick_widgets[10].result = &toption_save_position; 166 quick_widgets[11].result = &tedit_confirm_save; 167 quick_widgets[12].result = &toption_fill_tabs_with_spaces; 168 quick_widgets[13].result = &toption_return_does_auto_indent; 169 quick_widgets[14].result = &toption_backspace_through_tabs; 170 quick_widgets[15].result = &toption_fake_half_tabs; 162 171 163 172 if (option_auto_para_formatting) 164 173 wrap_mode = 1; … … edit_options_dialog (void) 167 176 else 168 177 wrap_mode = 0; 169 178 170 quick_widgets[1 4].result = &wrap_mode;171 quick_widgets[1 4].value = wrap_mode;179 quick_widgets[16].result = &wrap_mode; 180 quick_widgets[16].value = wrap_mode; 172 181 173 quick_widgets[1 6].result = &tedit_key_emulation;174 quick_widgets[1 6].value = tedit_key_emulation;182 quick_widgets[18].result = &tedit_key_emulation; 183 quick_widgets[18].value = tedit_key_emulation; 175 184 176 185 Quick_options.widgets = quick_widgets; 177 186 … … edit_options_dialog (void) 193 202 194 203 option_persistent_selections = tedit_persistent_selections; 195 204 option_syntax_highlighting = tedit_syntax_highlighting; 205 visible_tabs = tedit_visible_tabs; 206 visible_tws = tedit_visible_tws; 196 207 edit_confirm_save = tedit_confirm_save; 197 208 option_save_position = toption_save_position; 198 209 option_fill_tabs_with_spaces = toption_fill_tabs_with_spaces; … … edit_options_dialog (void) 219 230 220 231 /* Load or unload syntax rules if the option has changed */ 221 232 if (option_syntax_highlighting != old_syntax_hl) 222 233 edit_load_syntax (wedit, NULL, option_syntax_type); 223 234 /* Load usermap if it's needed */ 224 235 edit_load_user_map (wedit); 225 236 }