The Wayback Machine - https://web.archive.org/web/20201021223231/https://github.com/ocaml/merlin/issues/424
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

"reset" broken in master branch? #424

Closed
db4 opened this issue Aug 19, 2015 · 3 comments
Closed

"reset" broken in master branch? #424

db4 opened this issue Aug 19, 2015 · 3 comments

Comments

@db4
Copy link
Contributor

@db4 db4 commented Aug 19, 2015

PROTOCOL.md says that

### ["reset"]
Clear content of virtual buffer.

and "reset" really did that before. Now I have switched to master branch and "reset" seems to be ignored:

["reset","ml","test.ml"]
["return",{"cursor":{"line":1,"col":0},"marker":false}]
["tell","source","let x = 1\n"]
["return",{"cursor":{"line":2,"col":0},"marker":false}]
["tell","eof"]
["return",{"cursor":{"line":2,"col":0},"marker":false}]
["outline"]
["return",[{"start":{"line":1,"col":4},"end":{"line":3,"col":0},"name":"x","kind":"Value","children":[]}]]
["reset","ml","test.ml"]
["return",{"cursor":{"line":2,"col":0},"marker":false}]
["tell","source","let x = 1\n"]
["return",{"cursor":{"line":2,"col":0},"marker":false}]
["tell","eof"]
["return",{"cursor":{"line":2,"col":0},"marker":false}]
["outline"]
["return",[{"start":{"line":1,"col":4},"end":{"line":1,"col":9},"name":"x","kind":"Value","children":[]},{"start":{"line":1,"col":13},"end":{"line":3,"col":0},"name":"x","kind":"Value","children":[]}]]

Note that "let x = 1\n" value is duplicated.

@let-def
Copy link
Contributor

@let-def let-def commented Aug 19, 2015

Yes, reset is no longer doing as told. It is used to "checkout" the content of a buffer.
The goal is to minimize the logic on editor side. The protocol is still being heavily adjusted.

What you want can be obtained by adding a ["seek","before",{"col":0,"line":0}], so that virtual cursor is at the beginning.

@db4
Copy link
Contributor Author

@db4 db4 commented Aug 19, 2015

What you want can be obtained by adding a ["seek","before",{"col":0,"line":0}], so that virtual cursor is at the beginning.

Thanks! Now it works. But is line=0 correct? I thought merlin counted lines from 1.

@let-def
Copy link
Contributor

@let-def let-def commented Aug 25, 2015

Yes lines are counted from 1.
So before line 0 as the effect of clearing the buffer, but before line 1 would work equally well :).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.