diff -urN edit_PREV/ChangeLog edit/ChangeLog
old
|
new
|
|
| 1 | 2009-03-29 Vit Rosin <vit_r@list.ru> |
| 2 | * edit.c (edit_insert_file): When chars are inserted place cursor after |
| 3 | inserted chars. If next key press is <Down-arrow>,- move cursor to the insert-start clmn. |
| 4 | Its _NOT_ patch yet, - to try and discuss only. |
1 | 5 | 2007-11-02 Vladimir Nadvornik <nadvornik@suse.cz> |
2 | 6 | |
3 | 7 | * editlock.c (lock_build_name): Check the return value of getpwuid(). |
diff -urN edit_PREV/edit.c edit/edit.c
old
|
new
|
|
70 | 70 | int option_edit_left_extreme = 0; |
71 | 71 | int option_edit_top_extreme = 0; |
72 | 72 | int option_edit_bottom_extreme = 0; |
| 73 | static long flow_insert_col = -1; |
| 74 | |
73 | 75 | |
74 | 76 | const char *option_whole_chars_search = "0123456789abcdefghijklmnopqrstuvwxyz_"; |
75 | 77 | char *option_backup_ext = NULL; |
… |
… |
|
267 | 268 | char *p; |
268 | 269 | if ((p = edit_get_filter (filename))) { |
269 | 270 | FILE *f; |
270 | | long current = edit->curs1; |
| 271 | flow_insert_col = edit->curs_col; |
271 | 272 | f = (FILE *) popen (p, "r"); |
272 | 273 | if (f) { |
273 | 274 | edit_insert_stream (edit, f); |
274 | | edit_cursor_move (edit, current - edit->curs1); |
275 | 275 | if (pclose (f) > 0) { |
276 | 276 | GString *errmsg = g_string_new (NULL); |
277 | 277 | g_string_sprintf (errmsg, _(" Error reading from pipe: %s "), p); |
… |
… |
|
291 | 291 | g_free (p); |
292 | 292 | } else { |
293 | 293 | int i, file, blocklen; |
294 | | long current = edit->curs1; |
| 294 | flow_insert_col = edit->curs_col; |
295 | 295 | unsigned char *buf; |
296 | 296 | if ((file = mc_open (filename, O_RDONLY | O_BINARY)) == -1) |
297 | 297 | return 0; |
… |
… |
|
300 | 300 | for (i = 0; i < blocklen; i++) |
301 | 301 | edit_insert (edit, buf[i]); |
302 | 302 | } |
303 | | edit_cursor_move (edit, current - edit->curs1); |
304 | 303 | g_free (buf); |
305 | 304 | mc_close (file); |
306 | 305 | if (blocklen) |
… |
… |
|
2125 | 2124 | edit_push_key_press (edit); |
2126 | 2125 | |
2127 | 2126 | edit_execute_cmd (edit, command, char_for_insertion); |
| 2127 | if (CK_Down == command) { |
| 2128 | if (flow_insert_col >= 0) { |
| 2129 | edit->force |= REDRAW_COMPLETELY; |
| 2130 | edit_update_screen (edit); |
| 2131 | if (edit->curs_col > flow_insert_col) |
| 2132 | edit_cursor_move (edit, flow_insert_col - edit->curs_col); |
| 2133 | } |
| 2134 | } else if (CK_XPaste != command) { |
| 2135 | flow_insert_col = -1; |
| 2136 | } |
2128 | 2137 | if (column_highlighting) |
2129 | 2138 | edit->force |= REDRAW_PAGE; |
2130 | 2139 | } |