-
Notifications
You must be signed in to change notification settings - Fork 44
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
Allow getting the buffer handle and make Buffer
copy
#80
Conversation
@noib3 Is this okay? |
@oberblastmeister sorry for keeping it open so long, I'll make sure to review this this weekend. |
@@ -88,6 +88,10 @@ impl Pushable for Buffer { | |||
} | |||
|
|||
impl Buffer { | |||
pub fn handle(&self) -> BufHandle { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's missing a doc comment explaining what it returns.
@@ -27,7 +27,7 @@ use crate::LUA_INTERNAL_CALL; | |||
use crate::{Error, Result}; | |||
|
|||
/// A wrapper around a Neovim buffer handle. | |||
#[derive(Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] | |||
#[derive(Copy, Clone, Eq, PartialEq, Hash, Serialize, Deserialize)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not against making the handle wrapper types (i.e. Buffer
, Window
and TabPage
) Copy
(in fact at one point they were), but I'd change them all in the same commit.
0278204
to
6f23cf3
Compare
9e63751
to
3f75ed9
Compare
e70b241
to
6124b57
Compare
a1882fd
to
c1a89ca
Compare
Closed by #176, which added a Neither of those is |
Getting the internal handle is useful when
nxim_oxi
hasn't made bindings to something yet. I also don't see whyBuffer
shouldn't beCopy
, as it's just an integer. I also don't see how the internals ofBuffer
could be changed to something!Copy
in the future. I think the other types likeWindow
should be madeCopy
too.