[Bug] Unable to save include file ink contents at the first try when checking "Add to main ink"
- Dominant language
- JavaScript
- Stars
- 2.7k
- Forks
- 340
- PR merge metrics
- No merged PRs in 30d
Description
**Reproduction steps:**
Add new include ink file in a subfolder of an ink project (like chapter1/section1.ink):
0. Check "Add to main ink" (if it is not already done):
1. Click on "Add new ink file name" to the bottom left" in the Inky app.
2. Write a name with a folder path in it and click Add: chapter1/section1.ink
3. Write some text: Hi!
4. Save all changes in the project (Ctrl+S).
5. Open another file in the project by clicking on it in the project hierarchy (new a new one in the root if you don't have any).
6. Open the "chapter1/section1.ink" file again by clicking on it in the hierarchy.
7. The content of the file is "// Replace this comment with Ink and start writing!"
8. Try changing content of file to: Hi!
9. Save project changes.
10. When changing to another file and back again, the change to "Hi!" seems to persist now.
11. Close the Inky app.
12. You get unexpectedly a prompt to save.
13. Try to save.
14. The Inky app does not close.
15. Try to close and press "Don't save".
16. Reopen the Inky app with the same project.
17. The change is still there.
**Here is a work-around to avoid the bug:**
0. Uncheck "Add to main ink" (if it is not already done):
1. Click on "Add new ink file name" to the bottom left" in the Inky app.
2. Write a name with a folder path in it and click Add: chapter2/section2.ink
3. Write some text in the file: Hi!
4. Save the file, look at another file, and open the "chapter2/section2.ink" file again (you should copy the path for step 6).
5. Change seems to persist, and you can close and reopen project without losing the file.
6. Add following to the main ink file and save it: INCLUDE chapter2/section2.ink
7. The included file appears at the correct place in the hierarchy.
8. You need to reopen the Inky app to remove "chapter2/chapter1start.ink" from unused files in the hierarchy if you didn't restart the Inky app in step 5.
**Alternative reproduction procedure steps (remember to save files in subfolder paths when doing this):**
1.
Reproduce bug:
1. Create a file ink file in Inky with "Add new include" at the bottom left of the Inky app.
2. Replace the placeholder text with some other text, like a valid knot stub.
3. Save the file
4. Open another file and then open your new file again.
Result: You see the placeholder text in the file again.
2.
Reproduce bug:
1. Create a file ink file in Inky with "Add new include" at the bottom left of the Inky app.
2. Replace the placeholder text with some other text, like a valid knot stub.
3. Save the file
4. Close Ink
Result: You are prompted to save changes before exiting.
a. When pressing Save, the dialog box closes, but not the Inky app.
When pressing Don't save, the app closes.
b. When reopening the ink project in Inky again, the content of the file is now only the placeholder text again.
3.
This bug can be avoided or worked around by saving a new file with Ctrl+S without changing its placeholder, just after adding this new file to the project.
Then you can do changes safely. You still get a saving prompt when trying to close the Ink app. You then have to press "Don't save" to close, but the changes of the new file are not lost.
This may be related to the following issue:
https://github.com/inkle/inky/issues/197
New findings 19 Dec 2020:
This is an issue in Windows 10, 64-bit. I do not know how this is in Mac and Linux.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.