By Developers, For Developers
| PDF Pg | Paper Pg | Type | Description | Fixed on | Comments |
|---|---|---|---|---|---|
| 19.0 | TYPO | function! EchoQuote(): the epub version shows a space between the word function and the bang. If you type it in as it appears, it wont work; however, the downloaded code does work. | Not sure what I can do about this; the code in the book is pulled directly from the downloadable code. This sounds like an EPUB rendering error. | ||
| epub | SUGGEST | Chapter 1, section “Functions, Types, and Variables”: No explanation is given on how to call the function after sourcing the file. Before the output from the first version of EchoQuote, show: | 2015-01-28 | ||
| epub | SUGGEST | Chapter 1, section “Functions, Types, and Variables” First sentance should go above, where first appearance of “call | 2015-01-28 | ||
| epub | ERROR | Chapter 1, section “Funcref” If someone has been following along implementing the functions in order, this example will not work (the current version of the function requires arguments). A correct example would be: The downloadable source is also incorrect, but could be fixed by redefining the proper version of the function at the start of the file. | 2015-01-28 | ||
| epub | ERROR | Chapter 1, section “funcref”, 2nd example Text (and source file) defines variable ‘q’, but invokes function using variable ‘quote’ as the argument. | 2015-01-28 | ||
| 49 | ERROR | mpc#Decode is never called anywhere and so the syntax markers when running call mpc#OpenMPC() are visible. | Good catch. On the off chance that you’re using the system Vim in OS X Yosemite, though, I think that could have something to do with the characters being displayed; I am, and the conceal system is also broken for me in the help files. | ||
| 6 | TYPO | Mid-page, “function(‘EchoQuote’)”, the output of “echo string(Example)”, should be preceded with the double quote/arrow construct. | 2015-01-28 | ||
| 9 | ERROR | In “Iterating with for” section, it states that a for loop can be used with a List or Dictionary. However, a for loop can only be used with a List or a List of Lists. | 2015-01-28 | ||
| 11 | TYPO | On the fifth line from the top, =? should be ?. | 2015-01-28 | ||
| 17 | TYPO | The line starting “E730: …” should be preceded with a double quote/arrow. | 2015-01-28 | ||
| 24 | TYPO | On the 16th line, “…following hte path…” should be “…following the path…”. | 2015-01-28 | ||
| 34 | TYPO | On line 19, “))” should be “)”. | 2015-01-28 | ||
| epub | TYPO | Section ’Specifying a New Syntax“, towards the end (page 124 of 164 on iPad mini). ”Open the syntax file we created earlier, syntax/mpdv.vim…the code for the script does not have a contains clause as suggested in “… and then the key bit in these commands is the argument contains.” | 2015-01-28 | ||
| epub | ERROR | At the end of section “Our Project: An Interface for mpc”, (p 43 of 164), the final command is incorrect. “After doing that, run this: | 2015-01-28 | ||
| 11 | SUGGEST | The multi-sentences here are a bit clumsy. … using function and endfunction, but our functions must begin with uppercase letters in order to distinguish them from built-in functions. | 2015-01-28 | ||
| 12 | ERROR | “When we call the command, Vim prints the function’s output as a message:” No it doesn’t. A) There’s no command (did you have one previously but deleted it?) and B) sourcing the file wouldn’t run it anyway. I think what you may have intended was: :w | source % | call EchoQuote() | 2015-01-28 | ||
| 13 | TYPO | Your comma is in the wrong spot. Should be after ‘written’ What we saw in our last function, where our variables were written a:quote, was the argument scope | 2015-01-28 | ||
| 13 | TYPO | I wouldn’t call an l:scope variable a ‘function scoped’ variable. It’s confusing… the ‘l’ means local and will be easier to remember if you call it that. If you want, I would say, “A variable scoped locally to the function”. | 2015-01-28 | ||
| 14 | SUGGEST | Before moving on from scopes, you might want to mention the other scopes, b: s: w: t: and v:. At least give them :help internal-variables. I use s: a fair bit, and v: is something they’re going to encounter at some point. | 2015-01-28 | ||
| 16 | TYPO | You either need ‘let quote = …’ or ‘echo call(Example, [q, …’ | 2015-01-28 | ||
| 24 | TYPO | …before the function’s name is either the directory under autoload or Should be: … ‘last name is the function name’ | |||
| 26 | TYPO | I believe you mean “Make sure that mpd is running” instead of ‘mpc’ | |||
| 29 | TYPO | (if creative mapping) should be (if creative) mapping | |||
| 38 | TYPO | “No, calling the” should be “Now, calling the” | |||
| 40 | TYPO | “This one checks for a particular option” should be “This one sets a particular option” | |||
| 54 | SUGGEST | Manual padding of spaces is a bit hacky; Vim has printf for this. Why not just create the format string by which you format every line? As well, looping over the same data structure twice is verbose and inefficient. You could easily build up what you want with one iteration. And finally, you don’t actually need a “sort” to find the largest length… just set a value using a ternary operator and set the new max if it’s actually bigger than the existing max. I get, though, that you get to show how to use higher order functions if you use sort, and that might be a good reason to keep it, but you might want to show that it’s not actually necessary. Oh, and one other thing; my data from mpc doesn’t always give me a row for which a split(item, " @") actually yields 4 elements, which makes the `let [position, artist, album, title] = song` fail. I can fix that up, but because we iterate over it twice, I have to fix it twice. | |||
| 54 | SUGGEST | Here’s what I’ve written up to replace the GetPlayList() function. I just like this better… but I was wrong about the single iteration; I needed two as well. But this is smaller, illustrates the awesome power of `map()`, and handles output from `mpc` that doesn’t have 4 elements. function! FormatPlaylistEntry(dict, posSize, artistSize, albumSize) function! mpc#GetPlaylist() for item in results return playlist | |||
| epub | ERROR | In “Detecting the Current Filetype”, the first iteration of the ftdetect/mpc.vim does not work for me. Instead of coding: My guess is that’s just an ePub formatting issue, but it sure caused problems for me. Plus, the file name given - “filetype/mpc/ftdetect/mpdv.vim” - should actually read “plugin/mpc/ftdetect/mpdv.vim” | |||
| code | SUGGEST | The code should be better labeled and organized. Usually, code for books like this is identify with a chapter number so that it’s easy to see what’s being done where. The lack of clear organization makes it more difficult to work with than it should be. | |||
| code | ERROR | I followed the book through Chapter 5 and all was working well. However, when I restarted my machine and thus restarted vim, I was hit with a bunch or errors so bad that I had to move mpc out of the plugin directory. This happens repeatedly | |||
| 60 | TYPO | first line of the 3rd paragraph: | |||
| epub | ERROR | Section “Specifying a New Syntax”, the code given at vsyntax.1/mpc/syntax/mpdv.vim is missing the ‘contains xxx’ clause. However, the code in Figure 1 in that section does have the right code. | |||
| epub | TYPO | Section “Writing user Commands”. Code in Figure 1 (return substitute(s:statusline…) does not match the published code or what’s in the book. | |||
| 2 | SUGGEST | maybe a small imprecision that could be improved : “Did you catch the ! (bang) at the end of the function’s first line?” => the bang is after the `function` keyword, not at the end of the function’s first line. | |||
| 56 | ERROR | There is a bug in mpc#ToggleRandom. If repeat is on then the output of “mpc random” will look like this: “volume: n/a repeat: on random: …”. Note that there are FOUR spaces after “repeat: on” instead of three. So the value of status will be " random: off" or " random: on". It needs code like this to remove the leading space: if (state[0:0] == ’ ’) | |||
| 39 | ERROR | It is not practical to update the statusline using a function that calls system() to execute a somewhat long-running command, especially twice. See the discussion at h t t p s : / / groups.google.com/forum/#!topic/vim_use/4J0WGoinUCw |