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

compatibility with older vim? #7

Closed
mg979 opened this issue Dec 7, 2019 · 5 comments · Fixed by #8
Closed

compatibility with older vim? #7

mg979 opened this issue Dec 7, 2019 · 5 comments · Fixed by #8

Comments

@mg979
Copy link
Contributor

mg979 commented Dec 7, 2019

Is there a reason why it's using getbufline() and related functions, instead of getline()?
Are there cases where the working buffer is not the current buffer?

@hrsh7th
Copy link
Owner

hrsh7th commented Dec 7, 2019

I want to work in older vim too.
But 'deletebufline' can not replace to compatible code, I think. (appendbufline is replaceable to append...)

@hrsh7th
Copy link
Owner

hrsh7th commented Dec 7, 2019

Are there cases where the working buffer is not the current buffer?

I think cursor is always on the working buffer.

@mg979
Copy link
Contributor Author

mg979 commented Dec 7, 2019

Instead of deletebufline() you can use delete, example:

call deletebufline(bufnr, start, end)

becomes (using :delete and a range)

exe start . ',' . end . 'delete _'

where _ means to the black hole register (so that no registers are overwritten).

@hrsh7th
Copy link
Owner

hrsh7th commented Dec 7, 2019

Thanks! I try it.

@hrsh7th
Copy link
Owner

hrsh7th commented Dec 7, 2019

Thanks.

I've supported older vim!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants