Files
neovim/runtime/autoload
Matthew Chen 410ba8374d fix(tutor): open a temporary copy instead of original file #38522
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>
2026-03-31 15:27:06 -04:00
..
2023-09-13 17:23:45 +02:00
2023-09-13 17:23:45 +02:00
2021-09-13 16:33:41 +02:00
2022-07-26 11:26:23 +02:00
2023-09-13 17:23:45 +02:00
2017-04-29 01:47:36 +02:00
2017-04-29 01:47:36 +02:00
2021-09-22 06:12:06 -07:00
2022-07-02 11:06:03 +02:00
2020-06-10 22:21:14 +09:00
2019-07-29 20:50:07 +02:00
2024-01-02 11:43:18 +01:00
2023-09-13 17:23:45 +02:00
2021-05-02 13:00:38 -04:00

The autoload directory is for standard Vim autoload scripts.

These are functions used by plugins and for general use.  They will be loaded
automatically when the function is invoked.  See ":help autoload".

gzip.vim	for editing compressed files
netrw*.vim	browsing (remote) directories and editing remote files
tar.vim		browsing tar files
zip.vim		browsing zip files
paste.vim	common code for mswin.vim and menu.vim
spellfile.vim	downloading of a missing spell file

Omni completion files:
ccomplete.vim		C
csscomplete.vim		HTML / CSS
htmlcomplete.vim	HTML
javascriptcomplete.vim  Javascript
phpcomplete.vim		PHP
pythoncomplete.vim	Python
rubycomplete.vim	Ruby
syntaxcomplete.vim	from syntax highlighting
xmlcomplete.vim		XML (uses files in the xml directory)