Code automatically closes on certain .php files and doesn't want to reopen again
Prerequisites
- [y ] I have searched open and closed issues for duplicates.
Describe the bug
I have an issue opening certain .php file in Code. It just opens up and then closes itself right after.
To Reproduce
Steps to reproduce the behavior:
- Unzip my .php file buypoints.php.zip
- Edit this .php file in Code app.
Expected behavior
Code app should open for edition this .php file. Instead it shuts itself automatically down.
Reopening Code app is not helping, the .php file would load itself automatically as a recent document. Reinstalling not helping. Purging after uninstallation is also not helping.
The only solution for me was to rename .php file so that it would not start together with Code app anymore.
In topic #544 I found also that this command purges Code's settings, may be also helpful:
dconf reset -f /io/elementary/code/
but still, opening again this .php file is shutting the Code app down.
Platform Information
-
OS: elementary OS
-
OS Version Hera 5.1.2

-
[y] I'm using the latest released stable version of Code app
Additional context
I also tried to open Code app via terminal, feedback was: io.elementary.code
GtkSourceView:ERROR:gtksourcecontextengine.c:5543:update_syntax: assertion failed: (g_slist_length (ce->priv->invalid) <= 1) Aborted
Then I tried to reinstall Code, the feedback was: sudo apt install --reinstall io.elementary.code [sudo] password for zenondanon: Reading package lists... Done Building dependency tree Reading state information... Done The following packages were automatically installed and are no longer required: libllvm8 libllvm8:i386 linux-headers-5.0.0-37 linux-headers-5.0.0-37-generic linux-headers-5.3.0-26 linux-headers-5.3.0-26-generic linux-headers-5.3.0-28 linux-headers-5.3.0-28-generic linux-image-5.0.0-37-generic linux-image-5.3.0-26-generic linux-image-5.3.0-28-generic linux-modules-5.0.0-37-generic linux-modules-5.3.0-26-generic linux-modules-5.3.0-28-generic linux-modules-extra-5.0.0-37-generic linux-modules-extra-5.3.0-26-generic linux-modules-extra-5.3.0-28-generic Use 'sudo apt autoremove' to remove them. 0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 0 not upgraded. Need to get 0 B/426 kB of archives. After this operation, 0 B of additional disk space will be used. (Reading database ... 406081 files and directories currently installed.) Preparing to unpack .../io.elementary.code_3.3.0r3020+pkg130ubuntu5.1.2.1_amd64.deb ... Unpacking io.elementary.code (3.3.0r3020+pkg130ubuntu5.1.2.1) over (3.3.0r3020+pkg130ubuntu5.1.2.1) ... Setting up io.elementary.code (3.3.0r3020+pkg130ubuntu5.1.2.1) ... update-alternatives: using /usr/bin/io.elementary.code to provide /usr/bin/gnome-text-editor (gnome-text-editor) in auto mode Processing triggers for libglib2.0-0:amd64 (2.56.4-0ubuntu0.18.04.6) ... No such key 'button-layout' in schema 'org.gnome.mutter:Pantheon' as specified in override file '/usr/share/glib-2.0/schemas/20_elementary.pantheon.wm.gschema.override'; ignoring override for this key. No such key 'enable-animations' in schema 'org.gnome.mutter:Pantheon' as specified in override file '/usr/share/glib-2.0/schemas/20_elementary.pantheon.wm.gschema.override'; ignoring override for this key. Processing triggers for bamfdaemon (0.5.3+18.04.20180207.2-0ubuntu1) ... Rebuilding /usr/share/applications/bamf-2.index... Processing triggers for man-db (2.8.3-2ubuntu0.1) ... Processing triggers for gnome-menus (3.13.3-11ubuntu1.1) ... Processing triggers for hicolor-icon-theme (0.17-2) ... Processing triggers for mime-support (3.60ubuntu1) ... Processing triggers for desktop-file-utils (0.23-1ubuntu3.18.04.2+elementary2~ubuntu5.0.1) ... Processing triggers for libglib2.0-0:i386 (2.56.4-0ubuntu0.18.04.6) ... No such key 'button-layout' in schema 'org.gnome.mutter:Pantheon' as specified in override file '/usr/share/glib-2.0/schemas/20_elementary.pantheon.wm.gschema.override'; ignoring override for this key. No such key 'enable-animations' in schema 'org.gnome.mutter:Pantheon' as specified in override file '/usr/share/glib-2.0/schemas/20_elementary.pantheon.wm.gschema.override'; ignoring override for this key.
THIS CASE MAY BE HELPFUL, reason is similar: https://superuser.com/questions/408157/gedit-flashes-and-exit-automatically-when-opening-a-file
It may be somehow connected with BOM: https://en.wikipedia.org/wiki/Byte_order_mark
How do I fix this issue? Or is it something on the Code app side?
I had no problem opening the file with the current master version of Code so this problem seems to be fixed.
Closing as fix now released,