January 2015
Beginner to intermediate
85 pages
1h 58m
English
When we finished with OpenMPC at the end of Chapter 2, A Real Live Plugin, we opened a window with the :new, which simply opens a new window and immediately moves to it. When we run this command, the window we open displays the buffer name [No Name], because it has no name—we’ve opened a new window to nothing.
In our updated OpenMPC, if we’ve already opened a window, we reuse it. The :new command now opens a named buffer in the new window, and from then on we can refer to that window by the name of the buffer to which it’s opened.
So here’s our new process for opening the playlist window. We start by checking for a buffer with the buffer name we’ve devised:
| | function! OpenMPC() |
| | if(bufexists('mpc.mpdv' ... |
Read now
Unlock full access