(→‎Comments: Proposing not to create a new buffer if the current is empty)
m (→‎Comments: minor correction)
Line 9: Line 9:
 
414 function! s:HJKL(...)
 
414 function! s:HJKL(...)
 
415
 
415
416 "create new window for game
+
416 if bufname("%") != <nowiki>''</nowiki>
417 if bufname("%") != <nowiki>''</nowiki>
+
417 "create new window for game
 
418 new
 
418 new
 
419 resize 100
 
419 resize 100

Revision as of 13:36, 28 January 2011

Use this page to discuss script 3409 3409

  • Add constructive comments, bug reports, or discuss improvements (see the guideline).
  • Do not document the script here (the author should do that on vim.org).
  • This page may be out of date: check the script's vim.org page above, and its release notes.

Screenshot

screenshot

Comments

It could be useful if it does not create a new buffer if the one we are in is empty. For instance, I just changed the beginning of the HJKL() function to be

 414 function! s:HJKL(...)
 415 
 416     if bufname("%") != ''
 417         "create new window for game
 418         new
 419         resize 100
 420     endif
Community content is available under CC-BY-SA unless otherwise noted.