annotate src/farsi.c @ 9598:dd6f3e98646b

Added tag v7.4.2076 for changeset 3ca0fd9709b197c4ee254f45f8604a518dde54da
author Christian Brabandt <cb@256bit.org>
date Tue, 19 Jul 2016 22:45:07 +0200
parents 9b048dced116
children 4aead6a9b7a9
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 /* vi:set ts=8 sts=4 sw=4:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3 * VIM - Vi IMproved by Bram Moolenaar
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 *
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 * Do ":help uganda" in Vim to read copying and usage conditions.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6 * Do ":help credits" in Vim to see a list of people who contributed.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 * See README.txt for an overview of the Vim source code.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 * farsi.c: functions for Farsi language
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13
9403
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 9399
diff changeset
14 #include "vim.h"
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 9399
diff changeset
15
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 9399
diff changeset
16 #if defined(FEAT_FKMAP) || defined(PROTO)
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 9399
diff changeset
17
7801
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
18 static int toF_Xor_X_(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
19 static int F_is_TyE(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
20 static int F_is_TyC_TyD(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
21 static int F_is_TyB_TyC_TyD(int src, int offset);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
22 static int toF_TyB(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
23 static void put_curr_and_l_to_X(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
24 static void put_and_redo(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
25 static void chg_c_toX_orX(void);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
26 static void chg_c_to_X_orX_(void);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
27 static void chg_c_to_X_or_X(void);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
28 static void chg_l_to_X_orX_(void);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
29 static void chg_l_toXor_X(void);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
30 static void chg_r_to_Xor_X_(void);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
31 static int toF_leading(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
32 static int toF_Rjoin(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
33 static int canF_Ljoin(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
34 static int canF_Rjoin(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
35 static int F_isterm(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
36 static int toF_ending(int c);
a1e71a01dbd6 commit https://github.com/vim/vim/commit/d25c16e2f2776d50245bf31d6e4d5364f12d188e
Christian Brabandt <cb@256bit.org>
parents: 4352
diff changeset
37 static void lrswapbuf(char_u *buf, int len);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
40 * Convert the given Farsi character into a _X or _X_ type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
43 toF_Xor_X_(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
49 case BE: return _BE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
50 case PE: return _PE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
51 case TE: return _TE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
52 case SE: return _SE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
53 case JIM: return _JIM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
54 case CHE: return _CHE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
55 case HE_J: return _HE_J;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
56 case XE: return _XE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
57 case SIN: return _SIN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
58 case SHIN: return _SHIN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
59 case SAD: return _SAD;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
60 case ZAD: return _ZAD;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
61 case AYN: return _AYN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
62 case AYN_: return _AYN_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
63 case GHAYN: return _GHAYN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
64 case GHAYN_: return _GHAYN_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
65 case FE: return _FE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
66 case GHAF: return _GHAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
67 case KAF: return _KAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
68 case GAF: return _GAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
69 case LAM: return _LAM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
70 case MIM: return _MIM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
71 case NOON: return _NOON;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 case YE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
73 case YE_: return _YE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74 case YEE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
75 case YEE_: return _YEE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 case IE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
77 case IE_: return _IE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 case F_HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 tempc = _HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80
1880
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
81 if (p_ri && (curwin->w_cursor.col + 1
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
82 < (colnr_T)STRLEN(ml_get_curline())))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 tempc = _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 if (!p_ri && STRLEN(ml_get_curline()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 tempc = _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 return 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
107 * Convert the given Farsi character into Farsi capital character.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 */
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
109 static int
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
110 toF_TyA(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
114 case ALEF_: return ALEF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
115 case ALEF_U_H_: return ALEF_U_H;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
116 case _BE: return BE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
117 case _PE: return PE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
118 case _TE: return TE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
119 case _SE: return SE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
120 case _JIM: return JIM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
121 case _CHE: return CHE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
122 case _HE_J: return HE_J;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
123 case _XE: return XE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
124 case _SIN: return SIN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
125 case _SHIN: return SHIN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
126 case _SAD: return SAD;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
127 case _ZAD: return ZAD;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
128 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
129 case AYN_:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
130 case _AYN_: return AYN;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
131 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
132 case GHAYN_:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
133 case _GHAYN_: return GHAYN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
134 case _FE: return FE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
135 case _GHAF: return GHAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
136 /* I am not sure what it is !!! case _KAF_H: */
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
137 case _KAF: return KAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
138 case _GAF: return GAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
139 case _LAM: return LAM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
140 case _MIM: return MIM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
141 case _NOON: return NOON;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
142 case _YE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
143 case YE_: return YE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
144 case _YEE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
145 case YEE_: return YEE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
146 case TEE_: return TEE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
147 case _IE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
148 case IE_: return IE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
149 case _HE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
150 case _HE_: return F_HE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
151 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
152 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
153 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
154
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
155 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
156 * Is the character under the cursor+offset in the given buffer a join type.
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
157 * That is a character that is combined with the others.
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
158 * Note: the offset is used only for command line buffer.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
159 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
160 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
161 F_is_TyB_TyC_TyD(int src, int offset)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
162 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
163 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
164
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
165 if (src == SRC_EDT)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
166 c = gchar_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
167 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
168 c = cmd_gchar(AT_CURSOR+offset);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
169
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
170 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
171 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
172 case _LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
173 case _BE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
174 case _PE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
175 case _TE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
176 case _SE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
177 case _JIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
178 case _CHE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
179 case _HE_J:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
180 case _XE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
181 case _SIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
182 case _SHIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
183 case _SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
184 case _ZAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
185 case _TA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
186 case _ZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
187 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
188 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
189 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
190 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
191 case _FE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
192 case _GHAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
193 case _KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
194 case _KAF_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
195 case _GAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
196 case _MIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
197 case _NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
198 case _YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
199 case _YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
200 case _IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
201 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
202 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
203 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
204 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
205 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
206 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
207
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
208 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
209 * Is the Farsi character one of the terminating only type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
210 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
211 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
212 F_is_TyE(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
213 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
214 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
215 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
216 case ALEF_A:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
217 case ALEF_D_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
218 case DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
219 case ZAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
220 case RE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
221 case ZE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
222 case JE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
223 case WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
224 case WAW_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
225 case HAMZE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
226 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
227 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
228 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
229 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
230
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
231 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
232 * Is the Farsi character one of the none leading type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
233 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
234 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
235 F_is_TyC_TyD(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
236 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
237 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
238 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
239 case ALEF_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
240 case ALEF_U_H_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
241 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
242 case AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
243 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
244 case GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
245 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
246 case YE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
247 case IE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
248 case TEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
249 case YEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
250 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
251 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
252 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
253 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
254
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
255 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
256 * Convert a none leading Farsi char into a leading type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
257 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
258 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
259 toF_TyB(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
260 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
261 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
262 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
263 case ALEF_: return ALEF;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
264 case ALEF_U_H_: return ALEF_U_H;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
265 case _AYN_: return _AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
266 case AYN_: return AYN; /* exception - there are many of them */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
267 case _GHAYN_: return _GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
268 case GHAYN_: return GHAYN; /* exception - there are many of them */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
269 case _HE_: return _HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
270 case YE_: return YE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
271 case IE_: return IE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
272 case TEE_: return TEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
273 case YEE_: return YEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
274 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
275 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
276 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
277
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
278 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
279 * Overwrite the current redo and cursor characters + left adjust.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
280 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
281 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
282 put_curr_and_l_to_X(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
283 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
284 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
285
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
286 if (curwin->w_p_rl && p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
287 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
288
1880
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
289 if ((curwin->w_cursor.col < (colnr_T)STRLEN(ml_get_curline())))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
290 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
291 if ((p_ri && curwin->w_cursor.col) || !p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
292 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
293 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
294 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
295 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
296 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
297
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
298 if (F_is_TyC_TyD((tempc = gchar_cursor())))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
299 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
300 pchar_cursor(toF_TyB(tempc));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
301 AppendCharToRedobuff(K_BS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
302 AppendCharToRedobuff(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
303 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
304
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
305 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
306 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
307 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
308 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
309 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
310 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
312 put_and_redo(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
313 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
314
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
315 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
316 put_and_redo(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
317 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
318 pchar_cursor(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
319 AppendCharToRedobuff(K_BS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
320 AppendCharToRedobuff(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
321 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
322
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
323 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
324 * Change the char. under the cursor to a X_ or X type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
325 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
326 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
327 chg_c_toX_orX(void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
328 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
329 int tempc, curc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
330
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
331 switch ((curc = gchar_cursor()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
332 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
333 case _BE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
334 tempc = BE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
335 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
336 case _PE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
337 tempc = PE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
338 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
339 case _TE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
340 tempc = TE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
341 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
342 case _SE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
343 tempc = SE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
344 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
345 case _JIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
346 tempc = JIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
347 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
348 case _CHE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
349 tempc = CHE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
350 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
351 case _HE_J:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
352 tempc = HE_J;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
353 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
354 case _XE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
355 tempc = XE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
356 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
357 case _SIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
358 tempc = SIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
359 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
360 case _SHIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
361 tempc = SHIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
362 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
363 case _SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
364 tempc = SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
365 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
366 case _ZAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
367 tempc = ZAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
368 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
369 case _FE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
370 tempc = FE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
371 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
372 case _GHAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
373 tempc = GHAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
374 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
375 case _KAF_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
376 case _KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
377 tempc = KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
378 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
379 case _GAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
380 tempc = GAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
381 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
382 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
383 tempc = AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
384 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
385 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
386 tempc = AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
387 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
388 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
389 tempc = GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
390 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
391 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
392 tempc = GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
393 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
394 case _LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
395 tempc = LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
396 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
397 case _MIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
398 tempc = MIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
399 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
400 case _NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
401 tempc = NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
402 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
403 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
404 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
405 tempc = F_HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
406 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
407 case _YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
408 case _IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
409 case _YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
410 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
411 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
412 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
413 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
414 tempc = (curc == _YE ? YE_ :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
415 (curc == _IE ? IE_ : YEE_));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
416 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
417 tempc = (curc == _YE ? YE :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
418 (curc == _IE ? IE : YEE));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
419 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
420 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
421 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
422 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
423 if (curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
424 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
425 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
426 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
427 tempc = (curc == _YE ? YE_ :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
428 (curc == _IE ? IE_ : YEE_));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
429 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
430 tempc = (curc == _YE ? YE :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
431 (curc == _IE ? IE : YEE));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
432 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
433 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
434 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
435 tempc = (curc == _YE ? YE :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
436 (curc == _IE ? IE : YEE));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
437 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
438 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
439 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
440 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
441 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
442
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
443 if (tempc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
444 put_and_redo(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
445 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
447 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
448 * Change the char. under the cursor to a _X_ or X_ type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
449 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
450
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
451 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
452 chg_c_to_X_orX_(void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
453 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
454 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
456 switch (gchar_cursor())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
457 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
458 case ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
459 tempc = ALEF_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
460 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
461 case ALEF_U_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
462 tempc = ALEF_U_H_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
463 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
464 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
465 tempc = _AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
466 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
467 case AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
468 tempc = AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
469 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
470 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
471 tempc = _GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
472 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
473 case GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
474 tempc = GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
475 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
476 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
477 tempc = _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
478 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
479 case YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
480 tempc = YE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
481 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
482 case IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
483 tempc = IE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
484 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
485 case TEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
486 tempc = TEE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
487 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
488 case YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
489 tempc = YEE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
490 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
491 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
492 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
493 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
494
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
495 if (tempc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
496 put_and_redo(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
497 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
498
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
499 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
500 * Change the char. under the cursor to a _X_ or _X type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
501 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
502 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
503 chg_c_to_X_or_X (void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
504 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
505 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
506
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
507 tempc = gchar_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
508
1880
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
509 if (curwin->w_cursor.col + 1 < (colnr_T)STRLEN(ml_get_curline()))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
510 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
511 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
512
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
513 if ((tempc == F_HE) && (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
514 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
515 tempc = _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
516
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
517 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
518
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
519 put_and_redo(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
520 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
521 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
522
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
523 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
524 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
525
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
526 if ((tempc = toF_Xor_X_(tempc)) != 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
527 put_and_redo(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
528 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
529
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
530 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
531 * Change the character left to the cursor to a _X_ or X_ type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
532 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
533 static void
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
534 chg_l_to_X_orX_(void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
535 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
536 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
537
1880
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
538 if (curwin->w_cursor.col != 0 &&
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
539 (curwin->w_cursor.col + 1 == (colnr_T)STRLEN(ml_get_curline())))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
540 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
541
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
542 if (!curwin->w_cursor.col && p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
543 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
544
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
545 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
546 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
547 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
548 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
549
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
550 switch (gchar_cursor())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
551 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
552 case ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
553 tempc = ALEF_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
554 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
555 case ALEF_U_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
556 tempc = ALEF_U_H_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
557 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
558 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
559 tempc = _AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
560 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
561 case AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
562 tempc = AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
563 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
564 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
565 tempc = _GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
566 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
567 case GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
568 tempc = GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
569 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
570 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
571 tempc = _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
572 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
573 case YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
574 tempc = YE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
575 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
576 case IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
577 tempc = IE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
578 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
579 case TEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
580 tempc = TEE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
581 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
582 case YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
583 tempc = YEE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
584 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
585 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
586 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
587 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
588
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
589 if (tempc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
590 put_and_redo(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
591
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
592 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
593 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
594 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
595 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
596 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
597
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
598 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
599 * Change the character left to the cursor to a X or _X type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
600 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
601
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
602 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
603 chg_l_toXor_X (void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
604 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
605 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
606
1880
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
607 if (curwin->w_cursor.col != 0 &&
e5602d92da8c updated for version 7.2-177
vimboss
parents: 1624
diff changeset
608 (curwin->w_cursor.col + 1 == (colnr_T)STRLEN(ml_get_curline())))
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
609 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
610
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
611 if (!curwin->w_cursor.col && p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
612 return;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
613
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
614 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
615 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
616 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
617 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
618
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
619 switch (gchar_cursor())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
620 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
621 case ALEF_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
622 tempc = ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
623 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
624 case ALEF_U_H_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
625 tempc = ALEF_U_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
626 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
627 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
628 tempc = _AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
629 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
630 case AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
631 tempc = AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
632 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
633 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
634 tempc = _GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
635 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
636 case GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
637 tempc = GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
638 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
639 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
640 tempc = _HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
641 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
642 case YE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
643 tempc = YE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
644 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
645 case IE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
646 tempc = IE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
647 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
648 case TEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
649 tempc = TEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
650 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
651 case YEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
652 tempc = YEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
653 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
654 default:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
655 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
656 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
657
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
658 if (tempc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
659 put_and_redo(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
660
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
661 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
662 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
663 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
664 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
665 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
666
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
667 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
668 * Change the character right to the cursor to a _X or _X_ type
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
669 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
670
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
671 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
672 chg_r_to_Xor_X_(void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
673 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
674 int tempc, c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
675
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
676 if (curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
677 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
678 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
679 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
680
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
681 tempc = gchar_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
682
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
683 if ((c = toF_Xor_X_(tempc)) != 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
684 put_and_redo(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
685
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
686 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
687 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
688
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
689 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
690 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
691
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
692 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
693 * Map Farsi keyboard when in fkmap mode.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
694 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
695
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
696 int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
697 fkmap(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
698 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
699 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
700 static int revins;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
701
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
702 if (IS_SPECIAL(c))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
703 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
704
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
705 if (VIM_ISDIGIT(c) || ((c == '.' || c == '+' || c == '-' ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
706 c == '^' || c == '%' || c == '#' || c == '=') && revins))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
707 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
708 if (!revins)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
709 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
710 if (curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
711 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
712 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
713 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
714
8238
d7e1526ae1b9 commit https://github.com/vim/vim/commit/68c85fcdf31c104db21c96cd5871724e458c95ff
Christian Brabandt <cb@256bit.org>
parents: 7819
diff changeset
715 chg_c_toX_orX ();
d7e1526ae1b9 commit https://github.com/vim/vim/commit/68c85fcdf31c104db21c96cd5871724e458c95ff
Christian Brabandt <cb@256bit.org>
parents: 7819
diff changeset
716 chg_l_toXor_X ();
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
717
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
718 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
719 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
720 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
721 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
722
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
723 arrow_used = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
724 (void)stop_arrow();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
725
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
726 if (!curwin->w_p_rl && revins)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
727 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
729 ++revins;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
730 p_ri=1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
731 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
732 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
733 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
734 if (revins)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
735 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
736 arrow_used = TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
737 (void)stop_arrow();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
738
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
739 revins = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
740 if (curwin->w_p_rl)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
741 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
742 while ((F_isdigit(gchar_cursor())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
743 || (gchar_cursor() == F_PERIOD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
744 || gchar_cursor() == F_PLUS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
745 || gchar_cursor() == F_MINUS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
746 || gchar_cursor() == F_MUL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
747 || gchar_cursor() == F_DIVIDE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
748 || gchar_cursor() == F_PERCENT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
749 || gchar_cursor() == F_EQUALS))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
750 && gchar_cursor() != NUL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
751 ++curwin->w_cursor.col;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
752 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
753 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
754 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
755 if (curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
756 while ((F_isdigit(gchar_cursor())
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
757 || (gchar_cursor() == F_PERIOD
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
758 || gchar_cursor() == F_PLUS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
759 || gchar_cursor() == F_MINUS
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
760 || gchar_cursor() == F_MUL
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
761 || gchar_cursor() == F_DIVIDE
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
762 || gchar_cursor() == F_PERCENT
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
763 || gchar_cursor() == F_EQUALS))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
764 && --curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
765 ;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
766
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
767 if (!F_isdigit(gchar_cursor()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
768 ++curwin->w_cursor.col;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
769 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
770 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
771 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
772
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
773 if (!revins)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
774 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
775 if (curwin->w_p_rl)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
776 p_ri=0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
777 if (!curwin->w_p_rl)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
778 p_ri=1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
779 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
780
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
781 if ((c < 0x100) && (isalpha(c) || c == '&' || c == '^' || c == ';' ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
782 c == '\''|| c == ',' || c == '[' ||
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
783 c == ']' || c == '{' || c == '}' ))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
784 chg_r_to_Xor_X_();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
785
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
786 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
787
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
788 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
789 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
790 case '`':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
791 case ' ':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
792 case '.':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
793 case '!':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
794 case '"':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
795 case '$':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
796 case '%':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
797 case '^':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
798 case '&':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
799 case '/':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
800 case '(':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
801 case ')':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
802 case '=':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
803 case '\\':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
804 case '?':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
805 case '+':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
806 case '-':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
807 case '_':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
808 case '*':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
809 case ':':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
810 case '#':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
811 case '~':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
812 case '@':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
813 case '<':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
814 case '>':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
815 case '{':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
816 case '}':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
817 case '|':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
818 case '0':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
819 case '1':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
820 case '2':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
821 case '3':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
822 case '4':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
823 case '5':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
824 case '6':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
825 case '7':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
826 case '8':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
827 case '9':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
828 case 'B':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
829 case 'E':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
830 case 'F':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
831 case 'H':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
832 case 'I':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
833 case 'K':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
834 case 'L':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
835 case 'M':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
836 case 'O':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
837 case 'P':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
838 case 'Q':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
839 case 'R':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
840 case 'T':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
841 case 'U':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
842 case 'W':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
843 case 'Y':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
844 case NL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
845 case TAB:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
846
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
847 if (p_ri && c == NL && curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
848 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
849 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
850 * If the char before the cursor is _X_ or X_ do not change
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
851 * the one under the cursor with X type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
852 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
853
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
854 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
855
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
856 if (F_isalpha(gchar_cursor()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
857 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
858 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
859 return NL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
860 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
861
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
862 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
863 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
864
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
865 if (!p_ri && !curwin->w_cursor.col)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
866 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
867 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
868 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
869 case '0': return FARSI_0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
870 case '1': return FARSI_1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
871 case '2': return FARSI_2;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
872 case '3': return FARSI_3;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
873 case '4': return FARSI_4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
874 case '5': return FARSI_5;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
875 case '6': return FARSI_6;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
876 case '7': return FARSI_7;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
877 case '8': return FARSI_8;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
878 case '9': return FARSI_9;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
879 case 'B': return F_PSP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
880 case 'E': return JAZR_N;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
881 case 'F': return ALEF_D_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
882 case 'H': return ALEF_A;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
883 case 'I': return TASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
884 case 'K': return F_LQUOT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
885 case 'L': return F_RQUOT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
886 case 'M': return HAMZE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
887 case 'O': return '[';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
888 case 'P': return ']';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
889 case 'Q': return OO;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
890 case 'R': return MAD_N;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
891 case 'T': return OW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
892 case 'U': return MAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
893 case 'W': return OW_OW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
894 case 'Y': return JAZR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
895 case '`': return F_PCN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
896 case '!': return F_EXCL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
897 case '@': return F_COMMA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
898 case '#': return F_DIVIDE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
899 case '$': return F_CURRENCY;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
900 case '%': return F_PERCENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
901 case '^': return F_MUL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
902 case '&': return F_BCOMMA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
903 case '*': return F_STAR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
904 case '(': return F_LPARENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
905 case ')': return F_RPARENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
906 case '-': return F_MINUS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
907 case '_': return F_UNDERLINE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
908 case '=': return F_EQUALS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
909 case '+': return F_PLUS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
910 case '\\': return F_BSLASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
911 case '|': return F_PIPE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
912 case ':': return F_DCOLON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
913 case '"': return F_SEMICOLON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
914 case '.': return F_PERIOD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
915 case '/': return F_SLASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
916 case '<': return F_LESS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
917 case '>': return F_GREATER;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
918 case '?': return F_QUESTION;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
919 case ' ': return F_BLANK;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
920 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
921 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
922 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
923 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
924 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
925
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
926 switch ((tempc = gchar_cursor()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
927 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
928 case _BE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
929 case _PE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
930 case _TE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
931 case _SE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
932 case _JIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
933 case _CHE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
934 case _HE_J:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
935 case _XE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
936 case _SIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
937 case _SHIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
938 case _SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
939 case _ZAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
940 case _FE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
941 case _GHAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
942 case _KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
943 case _KAF_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
944 case _GAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
945 case _LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
946 case _MIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
947 case _NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
948 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
949 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
950 case _TA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
951 case _ZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
952 put_curr_and_l_to_X(toF_TyA(tempc));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
953 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
954 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
955 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
956
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
957 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
958 if (!curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
959 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
960 put_curr_and_l_to_X(AYN);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
961 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
962 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
963
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
964 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
965 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
966 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
967 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
968
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
969 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
970 tempc = AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
971 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
972 tempc = AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
973
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
974 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
975 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
976 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
977 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
978
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
979 put_curr_and_l_to_X(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
980
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
981 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
982 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
983 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
984
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
985 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
986 if (!curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
987 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
988 put_curr_and_l_to_X(GHAYN);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
989 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
990 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
991
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
992 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
993 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
994 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
995 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
996
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
997 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
998 tempc = GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
999 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1000 tempc = GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1001
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1002 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1003 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1004 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1005 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1006
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1007 put_curr_and_l_to_X(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1008 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1009 case _YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1010 case _IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1011 case _YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1012 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1013 if (!curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1014 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1015 put_curr_and_l_to_X((tempc == _YE ? YE :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1016 (tempc == _IE ? IE : YEE)));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1017 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1018 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1019
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1020 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1021 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1022 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1023 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1024
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1025 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1026 tempc = (tempc == _YE ? YE_ :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1027 (tempc == _IE ? IE_ : YEE_));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1028 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1029 tempc = (tempc == _YE ? YE :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1030 (tempc == _IE ? IE : YEE));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1031
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1032 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1033 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1034 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1035 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1036
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1037 put_curr_and_l_to_X(tempc);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1038 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1039 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1040
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1041 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1042 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1043
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1044 tempc = 0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1045
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1046 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1047 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1048 case '0': return FARSI_0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1049 case '1': return FARSI_1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1050 case '2': return FARSI_2;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1051 case '3': return FARSI_3;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1052 case '4': return FARSI_4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1053 case '5': return FARSI_5;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1054 case '6': return FARSI_6;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1055 case '7': return FARSI_7;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1056 case '8': return FARSI_8;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1057 case '9': return FARSI_9;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1058 case 'B': return F_PSP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1059 case 'E': return JAZR_N;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1060 case 'F': return ALEF_D_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1061 case 'H': return ALEF_A;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1062 case 'I': return TASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1063 case 'K': return F_LQUOT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1064 case 'L': return F_RQUOT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1065 case 'M': return HAMZE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1066 case 'O': return '[';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1067 case 'P': return ']';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1068 case 'Q': return OO;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1069 case 'R': return MAD_N;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1070 case 'T': return OW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1071 case 'U': return MAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1072 case 'W': return OW_OW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1073 case 'Y': return JAZR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1074 case '`': return F_PCN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1075 case '!': return F_EXCL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1076 case '@': return F_COMMA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1077 case '#': return F_DIVIDE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1078 case '$': return F_CURRENCY;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1079 case '%': return F_PERCENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1080 case '^': return F_MUL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1081 case '&': return F_BCOMMA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1082 case '*': return F_STAR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1083 case '(': return F_LPARENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1084 case ')': return F_RPARENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1085 case '-': return F_MINUS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1086 case '_': return F_UNDERLINE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1087 case '=': return F_EQUALS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1088 case '+': return F_PLUS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1089 case '\\': return F_BSLASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1090 case '|': return F_PIPE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1091 case ':': return F_DCOLON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1092 case '"': return F_SEMICOLON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1093 case '.': return F_PERIOD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1094 case '/': return F_SLASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1095 case '<': return F_LESS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1096 case '>': return F_GREATER;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1097 case '?': return F_QUESTION;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1098 case ' ': return F_BLANK;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1099 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1100 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1101
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1102 case 'a':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1103 tempc = _SHIN;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1104 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1105 case 'A':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1106 tempc = WAW_H;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1107 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1108 case 'b':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1109 tempc = ZAL;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1110 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1111 case 'c':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1112 tempc = ZE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1113 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1114 case 'C':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1115 tempc = JE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1116 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1117 case 'd':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1118 tempc = _YE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1119 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1120 case 'D':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1121 tempc = _YEE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1122 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1123 case 'e':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1124 tempc = _SE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1125 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1126 case 'f':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1127 tempc = _BE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1128 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1129 case 'g':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1130 tempc = _LAM;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1131 break;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1132 case 'G':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1133 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1134 {
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1135
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1136 if (gchar_cursor() == _LAM)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1137 chg_c_toX_orX ();
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1138 else if (p_ri)
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1139 chg_c_to_X_or_X ();
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1140 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1142 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1143 if (!curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1144 return ALEF_U_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1145
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1146 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1147 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1148
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1149 if (gchar_cursor() == _LAM)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1150 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1151 chg_c_toX_orX ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1152 chg_l_toXor_X ();
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1153 tempc = ALEF_U_H;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1154 }
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1155 else if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1156 {
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1157 tempc = ALEF_U_H_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1158 chg_l_toXor_X ();
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1159 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1160 else
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1161 tempc = ALEF_U_H;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1162
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1163 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1164 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1165
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1166 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1167 case 'h':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1168 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1169 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1170 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1171 chg_c_to_X_or_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1172
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1173 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1174
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1175 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1176 if (!curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1177 return ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1178
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1179 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1180 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1181
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1182 if (gchar_cursor() == _LAM)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1183 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1184 chg_l_toXor_X();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1185 del_char(FALSE);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1186 AppendCharToRedobuff(K_BS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1187
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1188 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1189 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1190
8238
d7e1526ae1b9 commit https://github.com/vim/vim/commit/68c85fcdf31c104db21c96cd5871724e458c95ff
Christian Brabandt <cb@256bit.org>
parents: 7819
diff changeset
1191 tempc = LA;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1192 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1193 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1194 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1195 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1196 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1197 tempc = ALEF_;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1198 chg_l_toXor_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1199 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1200 else
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1201 tempc = ALEF;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1202 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1203
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1204 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1205 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1206
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1207 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1208 case 'i':
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1209 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1210 {
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1211 if (!p_ri && !F_is_TyE(tempc))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1212 chg_c_to_X_orX_ ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1213 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1214 chg_c_to_X_or_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1215
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1216 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1217
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1218 if (!p_ri && !curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1219 return _HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1220
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1221 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1222 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1223
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1224 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1225 tempc = _HE_;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1226 else
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1227 tempc = _HE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1228
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1229 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1230 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1231 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1232 case 'j':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1233 tempc = _TE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1234 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1235 case 'J':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1236 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1237 {
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1238 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1239 chg_c_to_X_or_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1240
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1241 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1242
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1243 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1244 if (!curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1245 return TEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1246
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1247 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1248 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1249
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1250 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1251 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1252 tempc = TEE_;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1253 chg_l_toXor_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1254 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1255 else
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1256 tempc = TEE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1257
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1258 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1259 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1260
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1261 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1262 case 'k':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1263 tempc = _NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1264 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1265 case 'l':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1266 tempc = _MIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1267 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1268 case 'm':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1269 tempc = _PE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1270 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1271 case 'n':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1272 case 'N':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1273 tempc = DAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1274 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1275 case 'o':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1276 tempc = _XE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1277 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1278 case 'p':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1279 tempc = _HE_J;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1280 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1281 case 'q':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1282 tempc = _ZAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1283 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1284 case 'r':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1285 tempc = _GHAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1286 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1287 case 's':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1288 tempc = _SIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1289 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1290 case 'S':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1291 tempc = _IE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1292 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1293 case 't':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1294 tempc = _FE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1295 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1296 case 'u':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1297 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1298 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1299 if (!p_ri && !F_is_TyE(tempc))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1300 chg_c_to_X_orX_ ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1301 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1302 chg_c_to_X_or_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1303
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1304 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1305
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1306 if (!p_ri && !curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1307 return _AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1308
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1309 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1310 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1311
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1312 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1313 tempc = _AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1314 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1315 tempc = _AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1316
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1317 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1318 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1319 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1320 case 'v':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1321 case 'V':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1322 tempc = RE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1323 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1324 case 'w':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1325 tempc = _SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1326 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1327 case 'x':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1328 case 'X':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1329 tempc = _TA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1330 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1331 case 'y':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1332 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1333 {
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1334 if (!p_ri && !F_is_TyE(tempc))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1335 chg_c_to_X_orX_ ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1336 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1337 chg_c_to_X_or_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1338
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1339 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1340
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1341 if (!p_ri && !curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1342 return _GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1343
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1344 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1345 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1346
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1347 if (F_is_TyB_TyC_TyD(SRC_EDT, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1348 tempc = _GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1349 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1350 tempc = _GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1351
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1352 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1353 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1354
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1355 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1356 case 'z':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1357 tempc = _ZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1358 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1359 case 'Z':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1360 tempc = _KAF_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1361 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1362 case ';':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1363 tempc = _KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1364 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1365 case '\'':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1366 tempc = _GAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1367 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1368 case ',':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1369 tempc = WAW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1370 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1371 case '[':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1372 tempc = _JIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1373 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1374 case ']':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1375 tempc = _CHE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1376 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1377 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1378
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1379 if ((F_isalpha(tempc) || F_isdigit(tempc)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1380 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1381 if (!curwin->w_cursor.col && STRLEN(ml_get_curline()))
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1382 {
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1383 if (!p_ri && !F_is_TyE(tempc))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1384 chg_c_to_X_orX_ ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1385 if (p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1386 chg_c_to_X_or_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1387 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1388
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1389 if (curwin->w_cursor.col)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1390 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1391 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1392 dec_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1393
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1394 if (F_is_TyE(tempc))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1395 chg_l_toXor_X ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1396 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1397 chg_l_to_X_orX_ ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1398
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1399 if (!p_ri)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1400 inc_cursor();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1401 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1402 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1403 if (tempc)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1404 return tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1405 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1406 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1407
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1408 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1409 * Convert a none leading Farsi char into a leading type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1410 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1411 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1412 toF_leading(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1413 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1414 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1415 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1416 case ALEF_: return ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1417 case ALEF_U_H_: return ALEF_U_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1418 case BE: return _BE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1419 case PE: return _PE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1420 case TE: return _TE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1421 case SE: return _SE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1422 case JIM: return _JIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1423 case CHE: return _CHE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1424 case HE_J: return _HE_J;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1425 case XE: return _XE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1426 case SIN: return _SIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1427 case SHIN: return _SHIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1428 case SAD: return _SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1429 case ZAD: return _ZAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1430
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1431 case AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1432 case AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1433 case _AYN_: return _AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1434
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1435 case GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1436 case GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1437 case _GHAYN_: return _GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1438
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1439 case FE: return _FE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1440 case GHAF: return _GHAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1441 case KAF: return _KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1442 case GAF: return _GAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1443 case LAM: return _LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1444 case MIM: return _MIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1445 case NOON: return _NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1446
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1447 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1448 case F_HE: return _HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1449
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1450 case YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1451 case YE_: return _YE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1452
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1453 case IE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1454 case IE: return _IE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1455
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1456 case YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1457 case YEE_: return _YEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1458 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1459 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1460 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1461
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1462 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1463 * Convert a given Farsi char into right joining type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1464 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1465 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1466 toF_Rjoin(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1467 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1468 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1469 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1470 case ALEF: return ALEF_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1471 case ALEF_U_H: return ALEF_U_H_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1472 case BE: return _BE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1473 case PE: return _PE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1474 case TE: return _TE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1475 case SE: return _SE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1476 case JIM: return _JIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1477 case CHE: return _CHE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1478 case HE_J: return _HE_J;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1479 case XE: return _XE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1480 case SIN: return _SIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1481 case SHIN: return _SHIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1482 case SAD: return _SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1483 case ZAD: return _ZAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1484
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1485 case AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1486 case AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1487 case _AYN: return _AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1488
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1489 case GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1490 case GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1491 case _GHAYN_: return _GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1492
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1493 case FE: return _FE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1494 case GHAF: return _GHAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1495 case KAF: return _KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1496 case GAF: return _GAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1497 case LAM: return _LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1498 case MIM: return _MIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1499 case NOON: return _NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1500
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1501 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1502 case F_HE: return _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1503
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1504 case YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1505 case YE_: return _YE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1506
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1507 case IE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1508 case IE: return _IE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1509
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1510 case TEE: return TEE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1511
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1512 case YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1513 case YEE_: return _YEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1514 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1515 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1516 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1517
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1518 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1519 * Can a given Farsi character join via its left edj.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1520 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1521 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1522 canF_Ljoin(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1523 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1524 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1525 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1526 case _BE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1527 case BE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1528 case PE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1529 case _PE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1530 case TE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1531 case _TE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1532 case SE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1533 case _SE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1534 case JIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1535 case _JIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1536 case CHE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1537 case _CHE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1538 case HE_J:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1539 case _HE_J:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1540 case XE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1541 case _XE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1542 case SIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1543 case _SIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1544 case SHIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1545 case _SHIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1546 case SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1547 case _SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1548 case ZAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1549 case _ZAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1550 case _TA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1551 case _ZA:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1552 case AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1553 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1554 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1555 case AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1556 case GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1557 case GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1558 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1559 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1560 case FE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1561 case _FE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1562 case GHAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1563 case _GHAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1564 case _KAF_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1565 case KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1566 case _KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1567 case GAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1568 case _GAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1569 case LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1570 case _LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1571 case MIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1572 case _MIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1573 case NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1574 case _NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1575 case IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1576 case _IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1577 case IE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1578 case YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1579 case _YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1580 case YE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1581 case YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1582 case _YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1583 case YEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1584 case F_HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1585 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1586 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1587 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1588 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1589 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1590 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1591
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1592 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1593 * Can a given Farsi character join via its right edj.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1594 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1595 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1596 canF_Rjoin(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1597 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1598 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1599 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1600 case ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1601 case ALEF_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1602 case ALEF_U_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1603 case ALEF_U_H_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1604 case DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1605 case ZAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1606 case RE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1607 case JE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1608 case ZE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1609 case TEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1610 case TEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1611 case WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1612 case WAW_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1613 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1614 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1615
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1616 return canF_Ljoin(c);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1617
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1618 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1619
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1620 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1621 * is a given Farsi character a terminating type.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1622 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1623 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1624 F_isterm(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1625 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1626 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1627 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1628 case ALEF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1629 case ALEF_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1630 case ALEF_U_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1631 case ALEF_U_H_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1632 case DAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1633 case ZAL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1634 case RE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1635 case JE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1636 case ZE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1637 case WAW:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1638 case WAW_H:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1639 case TEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1640 case TEE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1641 return TRUE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1642 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1643
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1644 return FALSE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1645 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1646
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1647 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1648 * Convert the given Farsi character into a ending type .
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1649 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1650 static int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1651 toF_ending(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1652 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1653 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1654 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1655 case _BE: return BE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1656 case _PE: return PE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1657 case _TE: return TE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1658 case _SE: return SE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1659 case _JIM: return JIM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1660 case _CHE: return CHE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1661 case _HE_J: return HE_J;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1662 case _XE: return XE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1663 case _SIN: return SIN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1664 case _SHIN: return SHIN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1665 case _SAD: return SAD;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1666 case _ZAD: return ZAD;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1667 case _AYN: return AYN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1668 case _AYN_: return AYN_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1669 case _GHAYN: return GHAYN;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1670 case _GHAYN_: return GHAYN_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1671 case _FE: return FE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1672 case _GHAF: return GHAF;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1673 case _KAF_H:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1674 case _KAF: return KAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1675 case _GAF: return GAF;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1676 case _LAM: return LAM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1677 case _MIM: return MIM;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1678 case _NOON: return NOON;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1679 case _YE: return YE_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1680 case YE_: return YE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1681 case _YEE: return YEE_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1682 case YEE_: return YEE;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1683 case TEE: return TEE_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1684 case _IE: return IE_;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1685 case IE_: return IE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1686 case _HE:
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1687 case _HE_: return F_HE;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1688 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1689 return c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1690 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1691
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1692 /*
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1693 * Convert the Farsi 3342 standard into Farsi VIM.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1694 */
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1695 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1696 conv_to_pvim(void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1697 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1698 char_u *ptr;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1699 int lnum, llen, i;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1700
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1701 for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1702 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1703 ptr = ml_get((linenr_T)lnum);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1704
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1705 llen = (int)STRLEN(ptr);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1706
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1707 for (i = 0; i < llen-1; i++)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1708 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1709 if (canF_Ljoin(ptr[i]) && canF_Rjoin(ptr[i+1]))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1710 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1711 ptr[i] = toF_leading(ptr[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1712 ++i;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1713
3683
c1780b4cb995 updated for version 7.3.601
Bram Moolenaar <bram@vim.org>
parents: 1880
diff changeset
1714 while (canF_Rjoin(ptr[i]) && i < llen)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1715 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1716 ptr[i] = toF_Rjoin(ptr[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1717 if (F_isterm(ptr[i]) || !F_isalpha(ptr[i]))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1718 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1719 ++i;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1720 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1721 if (!F_isalpha(ptr[i]) || !canF_Rjoin(ptr[i]))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1722 ptr[i-1] = toF_ending(ptr[i-1]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1723 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1724 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1725 ptr[i] = toF_TyA(ptr[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1726 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1727 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1728
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1729 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1730 * Following lines contains Farsi encoded character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1731 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1732
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1733 do_cmdline_cmd((char_u *)"%s/\202\231/\232/ge");
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1734 do_cmdline_cmd((char_u *)"%s/\201\231/\370\334/ge");
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1735
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1736 /* Assume the screen has been messed up: clear it and redraw. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1737 redraw_later(CLEAR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1738 MSG_ATTR(farsi_text_1, hl_attr(HLF_S));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1739 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1740
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1741 /*
4352
04736b4030ec updated for version 7.3.925
Bram Moolenaar <bram@vim.org>
parents: 3683
diff changeset
1742 * Convert the Farsi VIM into Farsi 3342 standard.
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1743 */
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1744 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1745 conv_to_pstd(void)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1746 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1747 char_u *ptr;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1748 int lnum, llen, i;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1749
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1750 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1751 * Following line contains Farsi encoded character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1752 */
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1753 do_cmdline_cmd((char_u *)"%s/\232/\202\231/ge");
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1754
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1755 for (lnum = 1; lnum <= curbuf->b_ml.ml_line_count; ++lnum)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1756 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1757 ptr = ml_get((linenr_T)lnum);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1758 llen = (int)STRLEN(ptr);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1759
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
1760 for (i = 0; i < llen; i++)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1761 ptr[i] = toF_TyA(ptr[i]);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1762 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1763
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1764 /* Assume the screen has been messed up: clear it and redraw. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1765 redraw_later(CLEAR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1766 MSG_ATTR(farsi_text_2, hl_attr(HLF_S));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1767 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1768
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1769 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1770 * left-right swap the characters in buf[len].
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1771 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1772 static void
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1773 lrswapbuf(char_u *buf, int len)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1774 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1775 char_u *s, *e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1776 int c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1777
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1778 s = buf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1779 e = buf + len - 1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1780
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1781 while (e > s)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1782 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1783 c = *s;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1784 *s = *e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1785 *e = c;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1786 ++s;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1787 --e;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1788 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1789 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1790
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1791 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1792 * swap all the characters in reverse direction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1793 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1794 char_u *
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1795 lrswap(char_u *ibuf)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1796 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1797 if (ibuf != NULL && *ibuf != NUL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1798 lrswapbuf(ibuf, (int)STRLEN(ibuf));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1799 return ibuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1800 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1801
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1802 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1803 * swap all the Farsi characters in reverse direction
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1804 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1805 char_u *
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1806 lrFswap(char_u *cmdbuf, int len)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1807 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1808 int i, cnt;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1809
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1810 if (cmdbuf == NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1811 return cmdbuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1812
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1813 if (len == 0 && (len = (int)STRLEN(cmdbuf)) == 0)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1814 return cmdbuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1815
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1816 for (i = 0; i < len; i++)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1817 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1818 for (cnt = 0; i + cnt < len
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1819 && (F_isalpha(cmdbuf[i + cnt])
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1820 || F_isdigit(cmdbuf[i + cnt])
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1821 || cmdbuf[i + cnt] == ' '); ++cnt)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1822 ;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1823
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1824 lrswapbuf(cmdbuf + i, cnt);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1825 i += cnt;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1826 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1827 return cmdbuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1828 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1829
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1830 /*
1624
18ee39301b82 updated for version 7.2a
vimboss
parents: 1224
diff changeset
1831 * Reverse the characters in the search path and substitute section
18ee39301b82 updated for version 7.2a
vimboss
parents: 1224
diff changeset
1832 * accordingly.
18ee39301b82 updated for version 7.2a
vimboss
parents: 1224
diff changeset
1833 * TODO: handle different separator characters. Use skip_regexp().
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1834 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1835 char_u *
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1836 lrF_sub(char_u *ibuf)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1837 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1838 char_u *p, *ep;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1839 int i, cnt;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1840
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1841 p = ibuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1842
388
f92bb1845823 updated for version 7.0101
vimboss
parents: 7
diff changeset
1843 /* Find the boundary of the search path */
396
afc60a6339a6 updated for version 7.0104
vimboss
parents: 388
diff changeset
1844 while (((p = vim_strchr(p + 1, '/')) != NULL) && p[-1] == '\\')
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1845 ;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1846
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1847 if (p == NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1848 return ibuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1849
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1850 /* Reverse the Farsi characters in the search path. */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1851 lrFswap(ibuf, (int)(p-ibuf));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1852
388
f92bb1845823 updated for version 7.0101
vimboss
parents: 7
diff changeset
1853 /* Now find the boundary of the substitute section */
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1854 if ((ep = (char_u *)strrchr((char *)++p, '/')) != NULL)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1855 cnt = (int)(ep - p);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1856 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1857 cnt = (int)STRLEN(p);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1858
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1859 /* Reverse the characters in the substitute section and take care of '\' */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1860 for (i = 0; i < cnt-1; i++)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1861 if (p[i] == '\\')
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1862 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1863 p[i] = p[i+1] ;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1864 p[++i] = '\\';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1865 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1866
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1867 lrswapbuf(p, cnt);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1868
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1869 return ibuf;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1870 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1871
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1872 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1873 * Map Farsi keyboard when in cmd_fkmap mode.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1874 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1875 int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
1876 cmdl_fkmap(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1877 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1878 int tempc;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1879
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1880 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1881 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1882 case '0':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1883 case '1':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1884 case '2':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1885 case '3':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1886 case '4':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1887 case '5':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1888 case '6':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1889 case '7':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1890 case '8':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1891 case '9':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1892 case '`':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1893 case ' ':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1894 case '.':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1895 case '!':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1896 case '"':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1897 case '$':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1898 case '%':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1899 case '^':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1900 case '&':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1901 case '/':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1902 case '(':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1903 case ')':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1904 case '=':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1905 case '\\':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1906 case '?':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1907 case '+':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1908 case '-':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1909 case '_':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1910 case '*':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1911 case ':':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1912 case '#':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1913 case '~':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1914 case '@':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1915 case '<':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1916 case '>':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1917 case '{':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1918 case '}':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1919 case '|':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1920 case 'B':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1921 case 'E':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1922 case 'F':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1923 case 'H':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1924 case 'I':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1925 case 'K':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1926 case 'L':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1927 case 'M':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1928 case 'O':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1929 case 'P':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1930 case 'Q':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1931 case 'R':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1932 case 'T':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1933 case 'U':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1934 case 'W':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1935 case 'Y':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1936 case NL:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1937 case TAB:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1938
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1939 switch ((tempc = cmd_gchar(AT_CURSOR)))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1940 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1941 case _BE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1942 case _PE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1943 case _TE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1944 case _SE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1945 case _JIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1946 case _CHE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1947 case _HE_J:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1948 case _XE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1949 case _SIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1950 case _SHIN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1951 case _SAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1952 case _ZAD:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1953 case _AYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1954 case _GHAYN:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1955 case _FE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1956 case _GHAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1957 case _KAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1958 case _GAF:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1959 case _LAM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1960 case _MIM:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1961 case _NOON:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1962 case _HE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1963 case _HE_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1964 cmd_pchar(toF_TyA(tempc), AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1965 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1966 case _AYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1967 cmd_pchar(AYN_, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1968 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1969 case _GHAYN_:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1970 cmd_pchar(GHAYN_, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1971 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1972 case _IE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1973 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1974 cmd_pchar(IE_, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1975 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1976 cmd_pchar(IE, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1977 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1978 case _YEE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1979 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1980 cmd_pchar(YEE_, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1981 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1982 cmd_pchar(YEE, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1983 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1984 case _YE:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1985 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR+1))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1986 cmd_pchar(YE_, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1987 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1988 cmd_pchar(YE, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1989 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1990
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1991 switch (c)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1992 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1993 case '0': return FARSI_0;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1994 case '1': return FARSI_1;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1995 case '2': return FARSI_2;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1996 case '3': return FARSI_3;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1997 case '4': return FARSI_4;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1998 case '5': return FARSI_5;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1999 case '6': return FARSI_6;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2000 case '7': return FARSI_7;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2001 case '8': return FARSI_8;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2002 case '9': return FARSI_9;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2003 case 'B': return F_PSP;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2004 case 'E': return JAZR_N;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2005 case 'F': return ALEF_D_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2006 case 'H': return ALEF_A;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2007 case 'I': return TASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2008 case 'K': return F_LQUOT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2009 case 'L': return F_RQUOT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2010 case 'M': return HAMZE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2011 case 'O': return '[';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2012 case 'P': return ']';
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2013 case 'Q': return OO;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2014 case 'R': return MAD_N;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2015 case 'T': return OW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2016 case 'U': return MAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2017 case 'W': return OW_OW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2018 case 'Y': return JAZR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2019 case '`': return F_PCN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2020 case '!': return F_EXCL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2021 case '@': return F_COMMA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2022 case '#': return F_DIVIDE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2023 case '$': return F_CURRENCY;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2024 case '%': return F_PERCENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2025 case '^': return F_MUL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2026 case '&': return F_BCOMMA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2027 case '*': return F_STAR;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2028 case '(': return F_LPARENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2029 case ')': return F_RPARENT;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2030 case '-': return F_MINUS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2031 case '_': return F_UNDERLINE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2032 case '=': return F_EQUALS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2033 case '+': return F_PLUS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2034 case '\\': return F_BSLASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2035 case '|': return F_PIPE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2036 case ':': return F_DCOLON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2037 case '"': return F_SEMICOLON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2038 case '.': return F_PERIOD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2039 case '/': return F_SLASH;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2040 case '<': return F_LESS;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2041 case '>': return F_GREATER;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2042 case '?': return F_QUESTION;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2043 case ' ': return F_BLANK;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2044 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2045
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2046 break;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2047
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2048 case 'a': return _SHIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2049 case 'A': return WAW_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2050 case 'b': return ZAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2051 case 'c': return ZE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2052 case 'C': return JE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2053 case 'd': return _YE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2054 case 'D': return _YEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2055 case 'e': return _SE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2056 case 'f': return _BE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2057 case 'g': return _LAM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2058 case 'G':
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2059 if (cmd_gchar(AT_CURSOR) == _LAM)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2060 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2061 cmd_pchar(LAM, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2062 return ALEF_U_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2063 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2064
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2065 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2066 return ALEF_U_H_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2067 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2068 return ALEF_U_H;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2069 case 'h':
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2070 if (cmd_gchar(AT_CURSOR) == _LAM)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2071 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2072 cmd_pchar(LA, AT_CURSOR);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2073 redrawcmdline();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2074 return K_IGNORE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2075 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2076
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2077 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2078 return ALEF_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2079 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2080 return ALEF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2081 case 'i':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2082 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2083 return _HE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2084 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2085 return _HE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2086 case 'j': return _TE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2087 case 'J':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2088 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2089 return TEE_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2090 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2091 return TEE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2092 case 'k': return _NOON;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2093 case 'l': return _MIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2094 case 'm': return _PE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2095 case 'n':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2096 case 'N': return DAL;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2097 case 'o': return _XE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2098 case 'p': return _HE_J;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2099 case 'q': return _ZAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2100 case 'r': return _GHAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2101 case 's': return _SIN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2102 case 'S': return _IE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2103 case 't': return _FE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2104 case 'u':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2105 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2106 return _AYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2107 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2108 return _AYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2109 case 'v':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2110 case 'V': return RE;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2111 case 'w': return _SAD;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2112 case 'x':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2113 case 'X': return _TA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2114 case 'y':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2115 if (F_is_TyB_TyC_TyD(SRC_CMD, AT_CURSOR))
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2116 return _GHAYN_;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2117 else
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2118 return _GHAYN;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2119 case 'z':
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2120 case 'Z': return _ZA;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2121 case ';': return _KAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2122 case '\'': return _GAF;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2123 case ',': return WAW;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2124 case '[': return _JIM;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2125 case ']': return _CHE;
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2126 }
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2127
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2128 return c;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2129 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2130
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2131 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2132 * F_isalpha returns TRUE if 'c' is a Farsi alphabet
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2133 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2134 int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
2135 F_isalpha(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2136 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2137 return ((c >= TEE_ && c <= _YE)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2138 || (c >= ALEF_A && c <= YE)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2139 || (c >= _IE && c <= YE_));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2140 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2141
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2142 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2143 * F_isdigit returns TRUE if 'c' is a Farsi digit
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2144 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2145 int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
2146 F_isdigit(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2147 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2148 return (c >= FARSI_0 && c <= FARSI_9);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2149 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2150
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2151 /*
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2152 * F_ischar returns TRUE if 'c' is a Farsi character.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2153 */
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2154 int
7819
f86adafb28d4 commit https://github.com/vim/vim/commit/78c0b7d43e5048fd71d12816659667834170c76d
Christian Brabandt <cb@256bit.org>
parents: 7801
diff changeset
2155 F_ischar(int c)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2156 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2157 return (c >= TEE_ && c <= YE_);
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2158 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2159
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2160 void
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2161 farsi_f8(cmdarg_T *cap UNUSED)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2162 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2163 if (p_altkeymap)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2164 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2165 if (curwin->w_farsi & W_R_L)
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2166 {
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2167 p_fkmap = 0;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2168 do_cmdline_cmd((char_u *)"set norl");
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2169 MSG("");
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2170 }
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2171 else
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2172 {
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2173 p_fkmap = 1;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2174 do_cmdline_cmd((char_u *)"set rl");
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2175 MSG("");
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2176 }
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2177
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2178 curwin->w_farsi = curwin->w_farsi ^ W_R_L;
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2179 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2180 }
9399
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2181
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2182 void
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2183 farsi_f9(cmdarg_T *cap UNUSED)
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2184 {
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2185 if (p_altkeymap && curwin->w_p_rl)
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2186 {
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2187 curwin->w_farsi = curwin->w_farsi ^ W_CONV;
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2188 if (curwin->w_farsi & W_CONV)
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2189 conv_to_pvim();
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2190 else
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2191 conv_to_pstd();
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2192 }
43b8570abbec commit https://github.com/vim/vim/commit/ee2615af64fdcee87d8e4b13b65356e77fbd969b
Christian Brabandt <cb@256bit.org>
parents: 8238
diff changeset
2193 }
9403
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 9399
diff changeset
2194
9b048dced116 commit https://github.com/vim/vim/commit/75464dc434c43efac60e8bfd9bec2a8b736407e9
Christian Brabandt <cb@256bit.org>
parents: 9399
diff changeset
2195 #endif /* FEAT_FKMAP */