Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vim] Add documentation #3217

Closed
wants to merge 1 commit into from
Closed

Conversation

mightyguava
Copy link
Contributor

Adds documentation for vim mode's programmatic API. It's way past due.

@marijnh I wasn't sure where to put it. I liked that the manual is a one pager so I stuck the vim part at the bottom. Happy to move it somewhere else.

@heppe @dbarnett @kevinushey since you all had a part in writing the API, could you take a look and check for inaccuracies/typos if you have the time? I suggest pulling the patch down and looking at the rendered HTML.

@marijnh
Copy link
Member

marijnh commented Apr 20, 2015

Wonderful! The bottom of the manual seems like a good place.

<dl>
<dt id="vimapi_setOption"><code><strong>setOption(name: string, value: any, ?cm: CodeMirror, ?cfg: object)</strong></code></dt>
<dd>Sets the value of a VIM option. <code>name</code> should
be the name of an option. If <code>cfg.scope</code> is not set
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a subtlety that for :set, setOption gets called twice, with and without cm, so even for local-only options you need to expect cm undefined and silently return. I'm not sure if that behavior was intentional. It leads to some ambiguity, and could probably just be fixed at the :set level to detect local-only options, but otherwise it should be documented.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a comment to defineOption to clarify that it's currently not possible to define a buffer-local option that does not have a global value. I mostly didn't add it to the current API because I'm planning to change the signature a bit in the next major release. The current one has far too many arguments.

@heppe
Copy link
Contributor

heppe commented Apr 20, 2015

LGTM

@dbarnett
Copy link
Contributor

Thanks! Left one comment (take it or leave it), but LGTM.

@mightyguava
Copy link
Contributor Author

Merged as d5fbfc9

@mightyguava mightyguava deleted the vimdoc branch April 26, 2015 00:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants