Skip to content

Fix bug while creating files with non-existing path structure

Roberto Metere requested to merge nitrogl/kile:master into master

To reproduce the bug.

  1. Create a blank latex document, e.g., from Article template (it doesn't matter which template).
  2. Save the file, e.g., as "main.tex".
  3. Either in the preamble or in in the document, include another LaTeX document with a non-existing path structure, e.g, \input{non-existing-dir/include-me}.
  4. As soon as you save the document, the included file appears in the Structure tab (in the Side bar).
  5. Double-click on the included file from the Structure tab.
  6. A warning message appears "Cannot find the included file. The file does not exist... non-existing-dir/include-me.tex. Do you want to create this file?"
  7. If you press yes, a file opens for editing in Kile; however, BUG: the file has not been actually created.
  8. In fact, if you write something in it and try to save the new file an error message appears (actually two).

If you include a file with \input{exising-dir/non-existing-file} or \input{non-existing-file}, then everything works as expected, i.e., the new file gets actually created in the filesystem.

I deduce that the root cause of this BUG is that the non-existing directory structure does not get created before creating the new blank file (this is basically what this patch does).

Hope this helps.

Merge request reports