## #1976 Bug using the new "set explicit root document" feature

nobody
5*
2016-11-20
2016-11-20
Anonymous
No

Hi,

First of all, thank you for the amazing TexStudio.

I have noticed a bug concerning the new “set explicit root document” feature.
The MWE is:
1. Start a new document (with the quick wizard for instance).
2. Put some text.
3. Save the document.
4. Set the document as explicit root document.
5. Close the document.
6. Open it again using the structure window. The document will be marked as “unsaved” although it is just opened.

This bug has been verified on version 2.11.2 compiled with QT 4.8.6 using Debian 8.

PS:
In fact, I am trying to reproduce another bug:
I was working on a large document with several included TeX files (as section or Tikz picture). Several times, when I was resolving issues from the TeX building process and clicking on items in the issue list, a second editor of an already open file is created (I had realized this fact by looking on the structure window, there are two entries of the same file).

The problem is when this bug happened, I started editing the TeX document using the new document that (I suppose) does not take into account the unsaved modifications. At last, When I try to save the correction, TexStudio warns me that the document had been externally modified and the nightmare begins…

In this case, I was using Tikz with \tikzexternalize and pdflatex with “-shell-escape”. It could be related to this strange behavior.

Does it justify another bug ticket ?

## Discussion

• Tim Hoffmann - 2016-11-20

Please open a separate ticket for each bug. Multiple topics within a thread are difficult to handle.

• Tim Hoffmann - 2016-11-20

@developers: The above procedure leads to a change of meta data, which causes the "unsaved" state. Reason and code path of the change to be investigated.

This is the undo stack:

```Current: 1/1
0:
META DATA CHANGE: Encoding: UTF-8=>UTF-8; Line-Ending: 1=>3
```