summaryrefslogtreecommitdiffstatshomepage
path: root/runtime/ftplugin/tutor.vim
AgeCommit message (Collapse)AuthorFiles
2026-03-31fix(tutor): open a temporary copy instead of original file #38522Matthew Chen1
Problem: `:Tutor` should open a copy of the tutor file instead of the original. This is because edits modify the original file buffer, and crashes or other misuse could potentially corrupt the original file even if it's WO. Solution: Copy the tutor file to a temp path before opening. Store the original path in `b:tutor_file` so metadata json loading still works. - `tutor#TutorCmd` will now copy the tutor file to a temp path via `tempname()` before opening with `drop`. Store the original path in `b:tutor_file` only after the buffer is created. - `tutor#LoadMetadata` now uses `b:tutor_file` to resolve the JSON path instead of `expand('%')`, which now points to the temp copy buffer - `ftplugin/tutor.vim` does not make the `tutor#LoadMetadata` call anymore. It was guarded by `filereadable(expand('%').'.json')` which fails for the new temp copy path logic . Instead, `tutor#LoadMetadata` is already called directly inside `tutor#TutorCmd` since we are already assumed to enable interactive. Co-authored-by: Phạm Bình An <111893501+brianhuster@users.noreply.github.com>
2025-05-13vim-patch:9.1.1384: still some problem with the new tutors filetype pluginbrianhuster1
Problem: still some problem with the new tutors filetype plugin Solution: refactor code to enable/disable tutor mode into tutor#EnableInteractive() function, include a test (Phạm Bình An) I find it annoying that Tutor's interactive mode is always on (or debug mode is off) even when I open a tutor file with :edit command. I think it makes more sense to make this "interactive mode": - Always on when it is opened with :Tutor command - Off otherwise For more references, see `:help` feature, it is a much better than :Tutor, since I don't have to run `:let g:help_debug = 1` just to be able to edit and save a help file Therefore, I remove `g:tutor_debug` closes: vim/vim#17299 https://github.com/vim/vim/commit/13bea589a25707c8f9e29b2920410bdcccd79bc5 Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2025-05-13vim-patch:3704b5b: runtime(tutor): improve tutor.vim plugin and filetype pluginbrianhuster1
- Set g:tutor_debug on startup if it doesn't exist so that users can get cmdline completion when interactively setting it. - set b:undo_ftplugin in filetype plugin - set default runtime file headers closes: vim/vim#17274 https://github.com/vim/vim/commit/3704b5b58ace1163522188e3228996c15e56820e Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
2024-04-30docs: various fixes (#28208)dundargoc1
Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: Famiu Haque <famiuhaque@proton.me> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Guilherme Soares <guilhermesoares1970@gmail.com> Co-authored-by: Jannik Buhr <jannik.m.buhr@gmail.com> Co-authored-by: thomaswuhoileong <72001875+thomaswuhoileong@users.noreply.github.com> Co-authored-by: tom-anders <13141438+tom-anders@users.noreply.github.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
2018-08-10tutor: don't set statusline (#8844)Felipe Morales1
also, remove unused function tutor#InfoText() fixes #8842
2017-07-15tutor: disable old method for setting "expect" regionsFelipe Morales1
tutor: remove movement mappings
2017-07-15tutor: don't enable folds by defaultFelipe Morales1
2017-07-15tutor: allow metadata to exist outside of the documents.Felipe Morales1
this makes 'expect' regions simpler to handle.
2015-11-28tutor: Update vim-tutor to 0.2.1Felipe Morales1
Also, some tweaks based on input by @fdinoff on gitter.
2015-09-27tutor-mode: update pluginFelipe Morales1
2015-08-15runtime: Include vim-tutor-modeFelipe Morales1
vim-tutor-mode provides a mechanism to write and read interactive tutorials in vim. It's aim is to replace the venerable vimtutor with a more modern system. The plugin's development is maintained at https://github.com/fmoralesc /vim-tutor-mode Closes #2351.