Menu

#44 snippet invokation failes with assertion failure

None
closed
nobody
2023-02-23
2021-01-16
No

I created a snippet that inserts some after text (ending in a newline).
Once in a while, using the snippet fails with something like:

(bluefish:146224): GLib-CRITICAL : 09:50:12.869: g_utf8_strlen: assertion 'p != NULL || max == 0' failed
(bluefish:146224): Gtk-CRITICAL
: 09:50:12.869: gtk_text_buffer_insert: assertion 'text != NULL' failed
doc_insert_two_strings, about to call doc_set_modified(0x557c2e569490,1)
(bluefish:146224): GLib-CRITICAL : 09:50:31.067: g_utf8_strlen: assertion 'p != NULL || max == 0' failed
(bluefish:146224): Gtk-CRITICAL
: 09:50:31.067: gtk_text_buffer_insert: assertion 'text != NULL' failed

I go to the snippet editor, click forward twice and then I can use the snippet again, and I get:
doc_insert_two_strings, about to call doc_set_modified(0x557c2e569490,1)
doc_insert_two_strings, about to call doc_set_modified(0x557c2e569490,1)

Discussion

  • Olivier Sessink

    Olivier Sessink - 2021-01-16

    can you send me the snippets file that causes this behavior?
    it is stored in ~/.bluefish/snippets

    does the snippet fail, or does bluefish crash completely?

     
  • Miguel Simoes

    Miguel Simoes - 2021-01-17

    Here it is. I've only added the snippet at the end.

    There is no crash, the cursor moves up a line or two (can't recall exactly now) and no text is inserted.

     
  • clansco

    clansco - 2021-01-17

    hi,
    it works… if you have some character Before, not a space or nl, or if you select something.
    as this it works without selection or character before :

    <branch title="python 2 to 3">
     <leaf type="insert" title="pdb" tooltip="">
      <before>import pdb; pdb.set_trace()</before>
      <after></after>
     </leaf>
    </branch> 
    

    Regards

     
    • Miguel Simoes

      Miguel Simoes - 2021-01-17

      it works sometimes, sometimes it fails (with assertion fail error),

      Once it fails, it doesn't work again, but it will work again if I go through the Edit Snippet process and click Forward, changing nothing.

       
  • clansco

    clansco - 2021-01-18

    Hi,
    in my .bluefich/snippets file I have 56 items as

    ([^>]+)</before>
    <after>
    

    I have 56 <after>, 79 <after> , 0 <before>, 0 <before></before></before></after></after>

    please don't use the code : <before></before><after>something</after>
    but use instead <before>something</before></after>
    
     
    • Miguel Simoes

      Miguel Simoes - 2021-01-18

      Thank you. I'll use that.

       
  • Olivier Sessink

    Olivier Sessink - 2021-01-19

    I found the problem, it is fixed in revision 8892

     
  • Dr. Martin Senftleben

    • labels: --> snippet fails
    • status: open --> closed
     
  • Dr. Martin Senftleben

    Fixed, hence this ticket will be closed.

     

Log in to post a comment.

MongoDB Logo MongoDB