Skip to content

Commit 9a00729

Browse files
committed
Sync MacVim channel code with Vim
1 parent 937f6a1 commit 9a00729

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

src/MacVim/MMBackend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ extern NSTimeInterval MMBalloonEvalInternalDelay;
155155
- (BOOL)imState;
156156
- (void)setImState:(BOOL)activated;
157157

158-
- (void *)addChannel:(channel_T *)channel which:(int)which;
158+
- (void *)addChannel:(channel_T *)channel part:(int)part;
159159
- (void)removeChannel:(void *)cookie;
160160

161161
#ifdef FEAT_BEVAL

src/MacVim/MMBackend.m

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -165,12 +165,12 @@ - (NSComparisonResult)serverNameCompare:(NSString *)string;
165165

166166
@interface MMChannel : NSObject {
167167
channel_T *channel;
168-
int which;
168+
int part;
169169
CFSocketRef socket;
170170
CFRunLoopSourceRef runLoopSource;
171171
}
172172

173-
- (id)initWithChannel:(channel_T *)c which:(int)w;
173+
- (id)initWithChannel:(channel_T *)c part:(int)p;
174174
- (void)read;
175175
@end
176176

@@ -1685,10 +1685,10 @@ - (void)setImState:(BOOL)activated
16851685
[self flushQueue:YES];
16861686
}
16871687

1688-
- (void *)addChannel:(channel_T *)channel which:(int)which
1688+
- (void *)addChannel:(channel_T *)channel part:(int)part
16891689
{
16901690
MMChannel *mmChannel =
1691-
[[MMChannel alloc] initWithChannel:channel which:which];
1691+
[[MMChannel alloc] initWithChannel:channel part:part];
16921692
return (__bridge void *)mmChannel;
16931693
}
16941694

@@ -3432,18 +3432,18 @@ static void socketReadCallback(CFSocketRef s,
34323432
[mmChannel read];
34333433
}
34343434

3435-
- (id)initWithChannel:(channel_T *)c which:(int)w
3435+
- (id)initWithChannel:(channel_T *)c part:(int)p
34363436
{
34373437
self = [super init];
34383438
if (!self) return nil;
34393439

34403440
channel = c;
3441-
which = w;
3441+
part = p;
34423442

34433443
// Tell CFRunLoop that we are interested in channel socket input.
34443444
CFSocketContext ctx = {0, (__bridge void *)self, NULL, NULL, NULL};
34453445
socket = CFSocketCreateWithNative(kCFAllocatorDefault,
3446-
channel->ch_pfd[which].ch_fd,
3446+
channel->ch_part[part].ch_fd,
34473447
kCFSocketReadCallBack,
34483448
&socketReadCallback,
34493449
&ctx);
@@ -3460,7 +3460,7 @@ - (id)initWithChannel:(channel_T *)c which:(int)w
34603460
- (void)read
34613461
{
34623462
#ifdef FEAT_CHANNEL
3463-
channel_read(channel, which, "MMChannel_read");
3463+
channel_read(channel, part, "MMChannel_read");
34643464
#endif
34653465
}
34663466

src/MacVim/gui_macvim.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2242,9 +2242,9 @@ static int vimModMaskToEventModifierFlags(int mods)
22422242
// -- Channel Support ------------------------------------------------------
22432243

22442244
void *
2245-
gui_macvim_add_channel(channel_T *channel, int which)
2245+
gui_macvim_add_channel(channel_T *channel, int part)
22462246
{
2247-
return [[MMBackend sharedInstance] addChannel:channel which:which];
2247+
return [[MMBackend sharedInstance] addChannel:channel part:part];
22482248
}
22492249

22502250
void

src/channel.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -300,7 +300,7 @@ add_channel(void)
300300
channel->ch_part[part].ch_inputHandler = -1;
301301
#endif
302302
#ifdef FEAT_GUI_MACVIM
303-
channel->ch_pfd[which].ch_inputHandler = 0;
303+
channel->ch_part[part].ch_inputHandler = 0;
304304
#endif
305305
channel->ch_part[part].ch_timeout = 2000;
306306
}
@@ -409,9 +409,9 @@ channel_gui_register_one(channel_T *channel, int part)
409409
# ifdef FEAT_GUI_MACVIM
410410
/* Tell Core Foundation we are interested in being called when there
411411
* is input on the editor connection socket. */
412-
if (channel->ch_pfd[which].ch_inputHandler == 0)
413-
channel->ch_pfd[which].ch_inputHandler = gui_macvim_add_channel(
414-
channel, which);
412+
if (channel->ch_part[part].ch_inputHandler == 0)
413+
channel->ch_part[part].ch_inputHandler = gui_macvim_add_channel(
414+
channel, part);
415415
# endif
416416
# endif
417417
# endif
@@ -480,10 +480,10 @@ channel_gui_unregister(channel_T *channel)
480480
}
481481
# else
482482
# ifdef FEAT_GUI_MACVIM
483-
if (channel->ch_pfd[which].ch_inputHandler != 0)
483+
if (channel->ch_part[part].ch_inputHandler != 0)
484484
{
485-
gui_macvim_remove_channel(channel->ch_pfd[which].ch_inputHandler);
486-
channel->ch_pfd[which].ch_inputHandler = 0;
485+
gui_macvim_remove_channel(channel->ch_part[part].ch_inputHandler);
486+
channel->ch_part[part].ch_inputHandler = 0;
487487
}
488488
# endif
489489
# endif

src/proto/gui_macvim.pro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ gui_mch_replace_dialog(exarg_T *eap);
228228
im_set_control(int enable);
229229

230230
void *
231-
gui_macvim_add_channel(channel_T *channel, int which);
231+
gui_macvim_add_channel(channel_T *channel, int part);
232232
void
233233
gui_macvim_remove_channel(void *cookie);
234234

0 commit comments

Comments
 (0)