adambard / learnxinyminutes-docs

Code documentation written as code! How novel and totally my idea!
https://learnxinyminutes.com/
Other
11.54k stars 3.36k forks source link

[Vimscript/en] line continuation and calling user functions #3844

Open jdjohnston opened 4 years ago

jdjohnston commented 4 years ago

As a 20+ years user of Vim, I was pleased to see a description of Vimscript AKA VimL included. However there are a couple of small items that need to be fixed. If HiPhish doesn't get to them, I'll see if I can get a PR ready. (It's been a while :))

Lines 45-46: "... pacing [sic] a backslash as the first non-whitespace ... " Changing the obvious typo to "placing" improves the sentence, but it could be smoother. Perhaps "typing a backslash" or "writing a backslash". "placing" does work, though.

Lines 491-492: The text states that one cannot call a user function directly. That's not true in an expression, say something like: :let x = myFunction(). True, :myFunction() isn't legal & requires :call myFunction(). (Maybe this is something Bram will "fix" in Vim9)

mribeirodantas commented 2 years ago

Thanks for reporting this issue! The typo has already been corrected, but your second comment still applies. Would you be willing to open a pull request with an update for that, @jdjohnston? Let me know if you need help with that.

jdjohnston commented 2 years ago

@mribeirodantas, I am interested. In fact, I had planned to follow-up on this, but that obviously never happened. :( With your prompting, I'll make more of an effort to get something done, but it won't be today or tomorrow. I'll aim to have something ready by the end of the month.

Something else that should be addressed is that vim9script is a real thing now. I don't believe legacy Vimscript will be deprecated any time soon, but I'd like to find something definite before adding that to the text of the pull request.

Sorry if that's confusing. I'm in a bit of a rush.

mribeirodantas commented 2 years ago

No, it's clear, thanks for sharing what you have in mind. Don't worry about deadlines, just let me know if you need help ;-)

jdjohnston commented 2 years ago

@mribeirodantas, I haven't forgotten about this. :) I've written some text about user functions and wrote two simple example functions to illustrate the difference between calling for return value and calling for side effect. I also found some good text that ensures that legacy Vim script (which is what this page describes) isn't deprecated.

However, I also found a few places on the page that could use some improvement. Please don't get me wrong. HiPhish did a remarkable job writing this (I've certainly learned from it). I'd like to try to make it even better. It will still clearly be HiPhish's work, just slightly edited.

I know you said not to worry about deadlines, but I do better with a definite goal. I'll give myself a fairly loose one: I'll try to have a PR ready sometime before the end of August.

mribeirodantas commented 2 years ago

That sounds great to me! We can also have two documents, vim legacy and vim9script, just like we have Python 2 and Python 3. I will assign this to you. Feel free to open a PR mentioning this issue and continuing the discussion there. Whatever suits you better! Have fun 😄

jdjohnston commented 9 months ago

@mribeirodantas Doesn't look like I will be handling this. At the time, I thought I would, but obviously nothing's been done. Sorry.