annotate src/farsi.c @ 8915:8cbf472483fa v7.4.1744

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