Skip to content

Commit 9978bb7

Browse files
brianhusterchrisbra
authored andcommitted
patch 9.1.1870: :Tutor may not work as expected
Problem: :Tutor may not work as expected Solution: set buftype=nowrite instead of nofile (Phạm Bình An) closes: #18613 Signed-off-by: Phạm Bình An <phambinhanctb2004@gmail.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
1 parent 0ef50d9 commit 9978bb7

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

runtime/autoload/tutor.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ function! tutor#TutorCmd(tutor_name)
211211
endif
212212

213213
call tutor#SetupVim()
214-
exe "edit ".l:to_open
214+
exe "drop ".l:to_open
215215
call tutor#EnableInteractive(v:true)
216216
endfunction
217217

@@ -225,7 +225,7 @@ endfunction
225225
function! tutor#EnableInteractive(enable)
226226
let enable = a:enable
227227
if enable
228-
setlocal buftype=nofile
228+
setlocal buftype=nowrite
229229
setlocal concealcursor+=inv
230230
setlocal conceallevel=2
231231
call tutor#ApplyMarks()

src/testdir/test_plugin_tutor.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ endfunc
1010

1111
func Test_auto_enable_interactive()
1212
Tutor
13-
call assert_equal('nofile', &buftype)
13+
call assert_equal('nowrite', &buftype)
1414
call assert_match('tutor#EnableInteractive', b:undo_ftplugin)
1515

1616
edit Xtutor/Xtest.tutor

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -734,6 +734,8 @@ static char *(features[]) =
734734

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
1870,
737739
/**/
738740
1869,
739741
/**/

0 commit comments

Comments
 (0)