Skip to content

Commit 5c6dbcb

Browse files
committed
patch 8.0.1026: GTK on-the-spot input has problems
Problem: GTK on-the-spot input has problems. (Gerd Wachsmuth) Solution: Support over-the-spot. (Yukihiro Nakadaira, Ketn Takata, closes #1215)
1 parent 4e83961 commit 5c6dbcb

12 files changed

Lines changed: 300 additions & 115 deletions

File tree

runtime/doc/mbyte.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -832,6 +832,9 @@ Use the RPM or port for your system.
832832

833833
Currently, GUI Vim supports three styles, |OverTheSpot|, |OffTheSpot| and
834834
|Root|.
835+
When compiled with |+GUI_GTK| feature, GUI Vim supports two styles,
836+
|OnTheSpot| and |OverTheSpot|. You can select the style with the 'imstyle'
837+
option.
835838

836839
*. on-the-spot *OnTheSpot*
837840
Preedit Area and Status Area are performed by the client application in

runtime/doc/options.txt

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4356,6 +4356,23 @@ A jump table for the options with a short description can be found at |Q_op|.
43564356
<
43574357
NOTE: This function is invoked very often. Keep it fast.
43584358

4359+
*'imstyle'* *'imst'*
4360+
'imstyle' 'imst' number (default 1)
4361+
global
4362+
{not in Vi}
4363+
{only available when compiled with |+xim| and
4364+
|+GUI_GTK|}
4365+
This option specifies the input style of Input Method.
4366+
Set to zero if you want to use on-the-spot style.
4367+
Set to one if you want to use over-the-spot style.
4368+
See: |xim-input-style|
4369+
4370+
For a long time on-the-spot sytle had been used in GTK version of vim,
4371+
however, it is known that it causes troubles when using mappings,
4372+
|single-repeat|, etc. Therefore over-the-spot style becomes the
4373+
default now. This should work fine for most people, however if you
4374+
have any problem with it, try using on-the-spot style.
4375+
43594376
*'include'* *'inc'*
43604377
'include' 'inc' string (default "^\s*#\s*include")
43614378
global or local to buffer |global-local|

src/edit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9683,7 +9683,7 @@ ins_left(
96839683
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
96849684
/* Only call start_arrow() when not busy with preediting, it will
96859685
* break undo. K_LEFT is inserted in im_correct_cursor(). */
9686-
if (!im_is_preediting())
9686+
if (p_imst == IM_OVER_THE_SPOT || !im_is_preediting())
96879687
#endif
96889688
{
96899689
start_arrow_with_change(&tpos, end_change);

src/ex_getln.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3468,7 +3468,8 @@ cursorcmd(void)
34683468

34693469
windgoto(msg_row, msg_col);
34703470
#if defined(FEAT_XIM) && defined(FEAT_GUI_GTK)
3471-
redrawcmd_preedit();
3471+
if (p_imst == IM_ON_THE_SPOT)
3472+
redrawcmd_preedit();
34723473
#endif
34733474
#ifdef MCH_CURSOR_SHAPE
34743475
mch_update_cursor();

0 commit comments

Comments
 (0)