techee left a comment (geany/geany#4349)

I checked why I get
```
(geany:2327411): Geany-CRITICAL **: 14:11:40.538: 
document_get_from_notebook_child: assertion 'IS_SCINTILLA(sci)' failed
```
for the first tab and what happens in this case. GTK behaves in a strange way 
when inserting the first tab - in this case, it fires the `switch-page` signal 
when the tab is inserted. For subsequent inserts this signal is not fired as 
part of the insertion process.

For the first tab it means that during document_create() when we create a new 
tab and insert it using notebook_new_tab(), the on_notebook_switch_page() 
signal handler gets fired at this point. However, this is still before the 
document is marked as valid in document_create() so document_find_by_sci() 
which this patch uses doesn't find the Scintilla object because it looks only 
for it inside valid documents.

I think what I did in on_notebook_switch_page() is more or less OK unless 
someone has a better idea.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/4349#issuecomment-3012815360
You are receiving this because you are subscribed to this thread.

Message ID: <geany/geany/pull/4349/[email protected]>

Reply via email to