Fix bug while creating files with non-existing path structure
To reproduce the bug.
- Create a blank latex document, e.g., from Article template (it doesn't matter which template).
- Save the file, e.g., as "main.tex".
- 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}
. - As soon as you save the document, the included file appears in the Structure tab (in the Side bar).
- Double-click on the included file from the Structure tab.
- 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?"
- If you press yes, a file opens for editing in Kile; however, BUG: the file has not been actually created.
- 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.