vim-patch:9.1.1870: :Tutor may not work as expected (#36343)

Problem:  :Tutor may not work as expected
Solution: set buftype=nowrite instead of nofile
          (Phạm Bình An)

closes: vim/vim#18613

9978bb77c6

Co-authored-by: Phạm Bình An <phambinhanctb2004@gmail.com>
This commit is contained in:
zeertzjq
2025-10-27 09:21:52 +08:00
committed by GitHub
parent cb71a3f066
commit fb6fd17f26
2 changed files with 3 additions and 3 deletions

View File

@@ -185,7 +185,7 @@ function! tutor#TutorCmd(tutor_name)
endif endif
call tutor#SetupVim() call tutor#SetupVim()
exe "edit ".l:to_open exe "drop ".l:to_open
call tutor#EnableInteractive(v:true) call tutor#EnableInteractive(v:true)
call tutor#ApplyTransform() call tutor#ApplyTransform()
endfunction endfunction
@@ -200,7 +200,7 @@ endfunction
function! tutor#EnableInteractive(enable) function! tutor#EnableInteractive(enable)
let enable = a:enable let enable = a:enable
if enable if enable
setlocal buftype=nofile setlocal buftype=nowrite
setlocal concealcursor+=inv setlocal concealcursor+=inv
setlocal conceallevel=2 setlocal conceallevel=2
lua require('nvim.tutor').apply_marks() lua require('nvim.tutor').apply_marks()

View File

@@ -11,7 +11,7 @@ endfunc
func Test_auto_enable_interactive() func Test_auto_enable_interactive()
Tutor Tutor
call assert_equal('nofile', &buftype) call assert_equal('nowrite', &buftype)
call assert_match('tutor#EnableInteractive', b:undo_ftplugin) call assert_match('tutor#EnableInteractive', b:undo_ftplugin)
edit Xtutor/Xtest.tutor edit Xtutor/Xtest.tutor