Scratch editor erases document content before it opens it

Bug #1179292 reported by Humberto F. da Luz Jr.
26
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Scratch
Fix Released
High
Mario Guerriero

Bug Description

For some reason when I open .tex files scratch erases its content, saves it, then a blank document is open.

Files with other extensions were open correctly by my experiments.

Maybe this is a file encoding related issue. The encoding of the files that cause this issue:

file --mime acronimos.tex
acronimos.tex: text/plain; charset=iso-8859-1

The encoding of the files that were open correctly is us-ascii.

A sample file is attached.

Revision history for this message
Humberto F. da Luz Jr. (humbfdljr-l) wrote :
affects: appcenter → scratch
Revision history for this message
Gabriel_P (gabp) wrote :

I can reproduce this. Terminal shows this:

[_LOG_LEVEL_INFO 21:43:35.683638] Application.vala:77: Scratch version: 2.0
[_LOG_LEVEL_INFO 21:43:35.683797] Application.vala:79: Kernel version: 3.2.0-41-generic-pae
[_LOG_LEVEL_DEBUG 21:43:35.692536] Settings.vala:158: Loading settings from schema 'org.pantheon.scratch.saved-state'
[_LOG_LEVEL_DEBUG 21:43:35.693344] Settings.vala:158: Loading settings from schema 'org.pantheon.scratch.settings'
[_LOG_LEVEL_DEBUG 21:43:35.695103] Settings.vala:158: Loading settings from schema 'org.pantheon.scratch.services'
[_LOG_LEVEL_DEBUG 21:43:35.951774] [Gtk] Connecting to session manager
[_LOG_LEVEL_DEBUG 21:43:36.168232] SplitView.vala:141: WelcomeScreen shown succefully
[_LOG_LEVEL_DEBUG 21:43:36.176221] SplitView.vala:149: WelcomeScreen hidden succefully
[_LOG_LEVEL_DEBUG 21:43:36.178222] SplitView.vala:87: View added succefully
[_LOG_LEVEL_INFO 21:43:36.278366] Document.vala:92: Opening "acronimos (copy).tex"
[_LOG_LEVEL_DEBUG 21:43:36.613515] Encoding.vala:277: Detected encoding of file "/home/gabriel/Descargas/acronimos (copy).tex" to be "WINDOWS-1251"
[_LOG_LEVEL_FATAL 21:43:36.622470] [Gtk] gtk_text_buffer_emit_insert: assertion `g_utf8_validate (text, len, NULL)' failed
[_LOG_LEVEL_FATAL 21:43:36.622617] Scratch will not function properly.
[_LOG_LEVEL_INFO 21:43:36.904015] Document.vala:230: File "acronimos (copy).tex" saved succefully

Cody Garver (codygarver)
Changed in scratch:
milestone: none → 2.0
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Rubén Reina (ruben-reina-dev) wrote :

It happened to me creating an 'sqlite' file in class. My document was blank, despite that, Scratch showed the data.

And when you open a file that cannot be well processed by Scratch it erases all the content without asking anything.

Changed in scratch:
assignee: nobody → Mario Guerriero (mefrio-g)
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.