Hi Cami,<br><br>Thanks a lot, now it's perfect.<br><br>Cheers<br>Amir<br><br><b><i>FD Cami <francois.cami@free.fr></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> <br>Hi List,<br><br>On Fri, 8 Jun 2007 01:20:50 +0200<br>FD Cami <francois.cami@free.fr> wrote:<br><br>> Patch attached & validated against the attached test file and sonata.py<br>> with tab_len = 8.<br><br>The same patch without the obvious memory leak...<br><br>Cheers<br><br>François Cami & Guillaume Duviol<br>--- ../geany-0.11/src/document.c 2007-05-21 17:36:37.000000000 +0200<br>+++ src/document.c 2007-06-08 07:06:17.000000000 +0200<br>@@ -1785,5 +1785,5 @@<br> void document_replace_tabs(gint idx)<br> {<br>- gint search_pos;<br>+ gint search_pos, pos_in_line, current_tab_true_length;<br>  gint tab_len;<br>  gchar *tab_str;<br>@@ -1797,5 +1797,4 @@<br>  ttf.chrg.cpMax = sci_get_length(doc_list[idx].sci);<br> 
 ttf.lpstrText = (gchar*)"\t";<br>- tab_str = g_strnfill(tab_len, ' ');<br> <br>  while (TRUE)<br>@@ -1804,12 +1803,15 @@<br>   if (search_pos == -1) break;<br> <br>+  pos_in_line = sci_get_col_from_position(doc_list[idx].sci,search_pos);<br>+  current_tab_true_length = tab_len - (pos_in_line % tab_len) ;<br>+  tab_str = g_strnfill(current_tab_true_length, ' ');<br>   sci_target_start(doc_list[idx].sci, search_pos);<br>   sci_target_end(doc_list[idx].sci, search_pos + 1);<br>   sci_target_replace(doc_list[idx].sci, tab_str, FALSE);<br>-  ttf.chrg.cpMin = search_pos + tab_len - 1; // next search starts after replacement<br>-  ttf.chrg.cpMax += tab_len - 1; // update end of range now text has changed<br>+  g_free(tab_str);<br>+  ttf.chrg.cpMin = search_pos + current_tab_true_length - 1; // next search starts after replacement<br>+  ttf.chrg.cpMax += current_tab_true_length - 1; // update end of range now text has changed<br>  }<br> 
 sci_end_undo_action(doc_list[idx].sci);<br>- g_free(tab_str);<br> }<br> <br>_______________________________________________<br>Geany mailing list<br>Geany@uvena.de<br>http://uvena.de/cgi-bin/mailman/listinfo/geany<br></francois.cami@free.fr></blockquote><br><p>
      <hr size=1><a href="http://us.rd.yahoo.com/evt=48250/*http://searchmarketing.yahoo.com/arp/sponsoredsearch_v9.php?o=US2226&cmp=Yahoo&ctv=AprNI&s=Y&s2=EM&b=50">Pinpoint customers </a>who are looking for what you sell.