When the plugin goes to the next task, it encounters an error due to unsaved changes in the current buffer. After pressing Enter or saving, it sometimes breaks and skips tasks while still counting failures, while at other times it functions correctly.
I got this behavior when i started this plugin for first time with :Training
Expected behavior.
Iterating through tasks witouth error message
Logs and Stack traces
Error executing vim.schedule lua callback: vim/_editor.lua:431: nvim_exec2(): Vim(edit):E37: No write since last change (add ! to override) stack traceback: [C]: in function 'nvim_exec2' vim/_editor.lua:431: in function 'cmd' C:/Users/user/nvim-training/plugin/nvim-training.lua:95: in function 'fn' vim/_editor.lua:351: in function <vim/_editor.lua:350>
Screenshots
No response
Additional Context
Adding code below before vim.cmd("sil e training.txt") at plugin/nvim-training.lua 94 ln seems to fix issue.
if vim.bo.modified then
vim.cmd("write!")
end
Environment
Windows, mac same issues nvim 0.10, powershell and iterm
Describe the bug
When the plugin goes to the next task, it encounters an error due to unsaved changes in the current buffer. After pressing Enter or saving, it sometimes breaks and skips tasks while still counting failures, while at other times it functions correctly.
https://github.com/user-attachments/assets/144acd9e-1d97-469e-b404-d794da05e9a7
How to reproduce the behavior
Expected behavior.
Iterating through tasks witouth error message
Logs and Stack traces
Screenshots
No response
Additional Context
Adding code below before
vim.cmd("sil e training.txt")
at plugin/nvim-training.lua 94 ln seems to fix issue.Environment