Skip to content

Commit 6654ed1

Browse files
committed
Fix merge
1 parent 8a5c995 commit 6654ed1

File tree

6 files changed

+34
-55
lines changed

6 files changed

+34
-55
lines changed

src/MacVim/gui_macvim.m

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
if ([lang isEqualToString:@"Japanese"])
7474
vim_setenv((char_u*)"LANG", (char_u*)"ja_JP.UTF-8");
7575

76-
if (mch_isdir("/opt/local/share/terminfo") == FALSE)
76+
if (mch_isdir((char_u*)"/opt/local/share/terminfo") == FALSE)
7777
vim_setenv((char_u*)"TERMINFO", (char_u*)"/usr/share/terminfo");
7878
}
7979

@@ -1280,11 +1280,7 @@
12801280

12811281

12821282
void
1283-
#if defined(FEAT_UIMFEP)
12841283
gui_im_set_active(int active)
1285-
#else // FEAT_UIMFEP
1286-
im_set_active(int active)
1287-
#endif // FEAT_UIMFEP
12881284
{
12891285
// Don't enable IM if imdisableactivate is true.
12901286
if (p_imdisableactivate && active)
@@ -1299,11 +1295,7 @@
12991295

13001296

13011297
int
1302-
#if defined(FEAT_UIMFEP)
13031298
gui_im_get_status(void)
1304-
#else // FEAT_UIMFEP
1305-
im_get_status(void)
1306-
#endif // FEAT_UIMFEP
13071299
{
13081300
return [[MMBackend sharedInstance] imState];
13091301
}

src/fileio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1273,7 +1273,7 @@ readfile(fname, sfname, from, lines_to_skip, lines_to_read, eap, flags)
12731273
if (STRICMP(fenc, "guess") == 0)
12741274
{
12751275
if (guess_encode(&fenc, &fenc_alloced, fname) != 0)
1276-
set_internal_string_var("b:x_guessed_fileencoding", fenc);
1276+
set_internal_string_var((char_u *)"b:x_guessed_fileencoding", fenc);
12771277
}
12781278

12791279
/*

src/globals.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -870,11 +870,12 @@ EXTERN int* (*iconv_errno) (void);
870870
#endif /* FEAT_MBYTE */
871871

872872
#ifdef FEAT_XIM
873-
# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM)
874-
# ifndef FEAT_GUI_MACVIM
873+
# ifndef FEAT_GUI_MACVIM
874+
# ifdef FEAT_GUI_GTK
875875
EXTERN GtkIMContext *xic INIT(= NULL);
876-
# else
876+
# else
877877
EXTERN XIC xic INIT(= NULL);
878+
# endif
878879
# endif
879880
# ifdef FEAT_GUI
880881
EXTERN guicolor_T xim_fg_color INIT(= INVALCOLOR);

src/mbyte.c

Lines changed: 22 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1276,7 +1276,9 @@ utf_char2cells(c)
12761276
{0xfe68, 0xfe6b},
12771277
{0xff01, 0xff60},
12781278
{0xffe0, 0xffe6},
1279-
{0x10000, 0x1fffd},
1279+
{0x1f200, 0x1f200},
1280+
{0x1f210, 0x1f231},
1281+
{0x1f240, 0x1f248},
12801282
{0x20000, 0x2fffd},
12811283
{0x30000, 0x3fffd}
12821284
};
@@ -4448,19 +4450,16 @@ iconv_end()
44484450
# define g_return_if_fail(x) if (!(x)) return;
44494451
# endif
44504452

4453+
# if defined(FEAT_GUI_GTK) || defined(FEAT_GUI_MACVIM) || defined(PROTO)
4454+
static int xim_has_preediting INIT(= FALSE); /* IM current status */
4455+
44514456
static int im_is_active = FALSE; /* IM is enabled for current mode */
44524457
static int preedit_is_active = FALSE;
44534458

44544459
static unsigned long im_commit_handler_id = 0;
44554460
# ifndef FEAT_GUI_MACVIM
44564461
static unsigned int im_activatekey_keyval = GDK_VoidSymbol;
44574462
static unsigned int im_activatekey_state = 0;
4458-
# endif
4459-
4460-
static GtkWidget *preedit_window = NULL;
4461-
static GtkWidget *preedit_label = NULL;
4462-
4463-
static void im_preedit_window_set_position(void);
44644463

44654464
static GtkWidget *preedit_window = NULL;
44664465
static GtkWidget *preedit_label = NULL;
@@ -4499,8 +4498,6 @@ im_set_active(int active)
44994498
{
45004499
if (gui.in_use)
45014500
gui_im_set_active(active);
4502-
else
4503-
uimfep_set_active(active);
45044501
}
45054502
# endif
45064503

@@ -4536,7 +4533,6 @@ im_set_position(int row, int col)
45364533
im_preedit_window_set_position();
45374534
}
45384535
}
4539-
# endif
45404536

45414537
# if 0 || defined(PROTO) /* apparently only used in gui_x11.c */
45424538
void
@@ -4561,31 +4557,8 @@ im_add_to_input(char_u *str, int len)
45614557
if (input_conv.vc_type != CONV_NONE)
45624558
vim_free(str);
45634559

4564-
# ifndef FEAT_GUI_MACVIM
45654560
if (p_mh) /* blank out the pointer if necessary */
45664561
gui_mch_mousehide(TRUE);
4567-
# endif
4568-
}
4569-
4570-
static void
4571-
im_preedit_window_set_position(void)
4572-
{
4573-
int x, y, w, h, sw, sh;
4574-
4575-
if (preedit_window == NULL)
4576-
return;
4577-
4578-
sw = gdk_screen_get_width(gtk_widget_get_screen(preedit_window));
4579-
sh = gdk_screen_get_height(gtk_widget_get_screen(preedit_window));
4580-
gdk_window_get_origin(gui.drawarea->window, &x, &y);
4581-
gtk_window_get_size(GTK_WINDOW(preedit_window), &w, &h);
4582-
x = x + FILL_X(gui.col);
4583-
y = y + FILL_Y(gui.row);
4584-
if (x + w > sw)
4585-
x = sw - w;
4586-
if (y + h > sh)
4587-
y = sh - h;
4588-
gtk_window_move(GTK_WINDOW(preedit_window), x, y);
45894562
}
45904563

45914564
static void
@@ -4608,10 +4581,12 @@ im_preedit_window_set_position(void)
46084581
y = sh - h;
46094582
gtk_window_move(GTK_WINDOW(preedit_window), x, y);
46104583
}
4584+
# endif
46114585

46124586
static void
46134587
im_preedit_window_open()
46144588
{
4589+
# ifndef FEAT_GUI_MACVIM
46154590
char *preedit_string;
46164591
char buf[8];
46174592
PangoAttrList *attr_list;
@@ -4655,22 +4630,27 @@ im_preedit_window_open()
46554630

46564631
g_free(preedit_string);
46574632
pango_attr_list_unref(attr_list);
4633+
# endif
46584634
}
46594635

46604636
static void
46614637
im_preedit_window_close()
46624638
{
4639+
# ifndef FEAT_GUI_MACVIM
46634640
if (preedit_window != NULL)
46644641
gtk_widget_hide(preedit_window);
4642+
# endif
46654643
}
46664644

46674645
static void
46684646
im_show_preedit()
46694647
{
46704648
im_preedit_window_open();
46714649

4650+
# ifndef FEAT_GUI_MACVIM
46724651
if (p_mh) /* blank out the pointer if necessary */
46734652
gui_mch_mousehide(TRUE);
4653+
# endif
46744654
}
46754655

46764656
static void
@@ -4806,9 +4786,6 @@ im_preedit_end_macvim()
48064786
im_preedit_abandon_macvim()
48074787
{
48084788
/* Abandon preedit text, don't send any backspace sequences. */
4809-
im_preedit_cursor = 0;
4810-
im_preedit_trailing = 0;
4811-
48124789
im_preedit_end_macvim();
48134790
}
48144791
#endif
@@ -4862,6 +4839,7 @@ im_preedit_changed_macvim(char *preedit_string, int start_index, int cursor_inde
48624839
char *preedit_string = NULL;
48634840

48644841
gtk_im_context_get_preedit_string(context, &preedit_string, NULL, NULL);
4842+
#endif
48654843

48664844
#ifdef XIM_DEBUG
48674845
xim_log("im_preedit_changed_cb(): %s\n", preedit_string);
@@ -4879,6 +4857,13 @@ im_preedit_changed_macvim(char *preedit_string, int start_index, int cursor_inde
48794857
xim_has_preediting = TRUE;
48804858
im_show_preedit();
48814859
}
4860+
4861+
# ifndef FEAT_GUI_MACVIM
4862+
g_free(preedit_string);
4863+
4864+
if (gtk_main_level() > 0)
4865+
gtk_main_quit();
4866+
# endif
48824867
}
48834868

48844869
void
@@ -5240,7 +5225,7 @@ im_get_status(void)
52405225
if (gui.in_use)
52415226
return gui_im_get_status();
52425227
else
5243-
return uimfep_get_status();
5228+
return im_is_active;
52445229
}
52455230
# endif
52465231

src/proto/gui_macvim.pro

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -221,13 +221,8 @@ void gui_macvim_get_window_layout(int *count, int *layout);
221221

222222
void im_set_position(int row, int col);
223223
void im_set_control(int enable);
224-
#if defined(FEAT_UIMFEP)
225224
void gui_im_set_active(int active);
226225
int gui_im_get_status(void);
227-
#else
228-
void im_set_active(int active);
229-
int im_get_status(void);
230-
#endif
231226

232227
void
233228
gui_mch_find_dialog(exarg_T *eap);

src/structs.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,12 @@ struct file_buffer
18091809
* the file. NULL when not using encryption. */
18101810
#endif
18111811

1812+
#ifdef FEAT_ODB_EDITOR
1813+
uint32_t b_odb_server_id; /* FourCC of the ODB server (0 if none) */
1814+
void *b_odb_token; /* NSAppleEventDescriptor (optional) */
1815+
char_u *b_odb_fname; /* Custom file name (optional) */
1816+
#endif
1817+
18121818
}; /* file_buffer */
18131819

18141820

0 commit comments

Comments
 (0)