Menu

#1647 red coloring in the structure window while the file exists

open
nobody
None
1
2016-11-12
2016-01-23
No

I work on a book project and I have many files (Jan Sunderman has access to my dropbox where the project is placed). I changed headings from paragraph and subparagraph to section and subsection and the separate files included with an \input command changed to red even when they were opened in texstudio. This is definitely a bug. The red changed to black when texstudio was closed and reopened.

Further information (about the files in question) can be demonstrated.

Bernhard

Discussion

  • Gilles Bonnet

    Gilles Bonnet - 2016-04-21

    I have a similar problem. Here is what I observed.
    1) I write in the main document: "\include{somefile}". It appears red in the structure window. Seems normal, the file does not exist yet.
    2) I create the file "somefile". The file still appear red in the structure Window, also it exists. It stays red even after running compilations.
    3) It does not stay red if I go back to the line "\include{somefile}", delete one letter and rewrite it. This seems to refresh the color in the structure window.

     
    • Tim Hoffmann

      Tim Hoffmann - 2016-04-24

      How exactly do you create the file? Here it works correctly if I left-click the red entry and confirm the message box that I want to create the file.

       
      • Gilles Bonnet

        Gilles Bonnet - 2016-04-25

        I created a new file by clicking on the first icon on the top left (a white page with a green plus sign), and then saved it.

         
        • Tim Hoffmann

          Tim Hoffmann - 2016-04-25

          That's a correct observation. The structure is currently not updated when saving a new file.

           
  • Bernhard Kleine

    Bernhard Kleine - 2016-04-26

    Is there hope that this behaviour will change soon?

     
  • Tim Hoffmann

    Tim Hoffmann - 2016-04-27

    We have two unrelated bugs here:

    Original Bug:

    This is likely some issue with the detection of document relations across multple files and/or folders. It does only happen in quite complex cases. One the one hand, I assume that not many users will encounter it, on the other hand, it's likely tedious to track the issue down. The combination results in a low priority.

    If you want to help and increase the chance that we look into it, you could try to strip the example down. If you can provide information like:

    • it does happen with this minmal example: ...
    • if I put all files in the same folder, it works/does not work
    • if I leave out this additional hirachy level, it does work

    this would help to reduce the work we have to do (and which we don't have the time for).

    Second bug mentioned by Gilles Bonnet

    This is just a matter of not updating the structure view.

    IMO it does not have a high priority as well:

    • It does only appear in the session in which you create the new file. Closing and reopening TXS fixes it.
    • A better way to create new files is to click on the red structure entry (or Ctrl+Click on the filename in the \input \ \include statement). When creating a file like this the bug does not show.
     

    Last edit: Tim Hoffmann 2016-04-27
  • Bernhard Kleine

    Bernhard Kleine - 2016-04-28

    I agree that the situation is very complex. BTW are there any limits to the depth of nested directories to be checked in Texstudio for the structure?

     
    • Tim Hoffmann

      Tim Hoffmann - 2016-05-01

      There is no limit.

       
  • Bernhard Kleine

    Bernhard Kleine - 2016-11-08

    Today I observed a related issue. Coming to my book after some time I noticed that a chapter in the structure window was shown in read and the divers files building up that chapter were also in red. However, when I clicked on one of the files, TXS complained that the file does not exist and ask to create it.
    I suspect a timing issue that results in the files not immediately found when opening TXS.
    Later the files could be opened but the colour did not change.

     
    • Tim Hoffmann

      Tim Hoffmann - 2016-11-10

      I rather think that this is not really timing but depends on the sequence of opening files. It's possibly like this: At the beginning texstudio does not find the file corresponding to the entry. This is likely because it cannot infer the correct full path. After opening further files, it has gained additional information and knows the correct path. When clicking, it can thus open the file.

      • Did you open some files in between?
      • Do you have Options -> Editor -> Automatically load included files enabled?

      The second part on staying red is likely the same missing structure color update as Gilles Bonnet noted above: https://sourceforge.net/p/texstudio/bugs/1647/#c5b0

       
  • Bernhard Kleine

    Bernhard Kleine - 2016-11-11

    No
    Yes

     
  • Tim Hoffmann

    Tim Hoffmann - 2016-11-12

    Thanks for the feedback.

    Still I don't see that we will target this any time soon. My original comments still hold:
    https://sourceforge.net/p/texstudio/bugs/1647/#4523

     

Log in to post a comment.