File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -15,6 +15,10 @@ def __eq__(self, other):
15
15
return (hasattr (other , 'code_data' ) and
16
16
other .code_data == self .code_data )
17
17
18
+ def __hash__ (self ):
19
+ """Return hash based on remote object id."""
20
+ return self .code_data .__hash__ ()
21
+
18
22
19
23
class RemoteMap (object ):
20
24
Original file line number Diff line number Diff line change @@ -124,3 +124,17 @@ def test_tabpages():
124
124
vim .current .tabpage = vim .tabpages [1 ]
125
125
eq (vim .tabpages [1 ], vim .current .tabpage )
126
126
eq (vim .windows [1 ], vim .current .window )
127
+
128
+
129
+ @with_setup (setup = cleanup )
130
+ def test_hash ():
131
+ d = {}
132
+ d [vim .current .buffer ] = "alpha"
133
+ eq (d [vim .current .buffer ], "alpha" )
134
+ vim .command ('new' )
135
+ d [vim .current .buffer ] = "beta"
136
+ eq (d [vim .current .buffer ], "beta" )
137
+ vim .command ('winc w' )
138
+ eq (d [vim .current .buffer ], "alpha" )
139
+ vim .command ('winc w' )
140
+ eq (d [vim .current .buffer ], "beta" )
You can’t perform that action at this time.
0 commit comments