Ticket #319: place_curs.patch

File place_curs.patch, 1.3 KB (added by angel_il, 10 years ago)
  • ChangeLog

    diff -urN edit_PREV/ChangeLog edit/ChangeLog
    old new  
     12009-03-17  Vit Rosin   <vit_r@list.ru> 
     2 
     3        * edit.c (edit_insert_file): Place cursor after inserted chars. 
     4 
    152007-11-02  Vladimir Nadvornik  <nadvornik@suse.cz> 
    26 
    37        * editlock.c (lock_build_name): Check the return value of getpwuid(). 
  • edit.c

    diff -urN edit_PREV/edit.c edit/edit.c
    old new  
    267267    char *p; 
    268268    if ((p = edit_get_filter (filename))) { 
    269269        FILE *f; 
    270         long current = edit->curs1; 
    271270        f = (FILE *) popen (p, "r"); 
    272271        if (f) { 
    273272            edit_insert_stream (edit, f); 
    274             edit_cursor_move (edit, current - edit->curs1); 
    275273            if (pclose (f) > 0) { 
    276274                GString *errmsg = g_string_new (NULL); 
    277275                g_string_sprintf (errmsg, _(" Error reading from pipe: %s "), p); 
     
    291289        g_free (p); 
    292290    } else { 
    293291        int i, file, blocklen; 
    294         long current = edit->curs1; 
    295292        unsigned char *buf; 
    296293        if ((file = mc_open (filename, O_RDONLY | O_BINARY)) == -1) 
    297294            return 0; 
     
    300297            for (i = 0; i < blocklen; i++) 
    301298                edit_insert (edit, buf[i]); 
    302299        } 
    303         edit_cursor_move (edit, current - edit->curs1); 
    304300        g_free (buf); 
    305301        mc_close (file); 
    306302        if (blocklen)