vim-patch:8.1.0932: remove Farsi support (#9622)

Problem:    Farsi support is outdated and unused.
Solution:   Delete the Farsi support.
14184a3133
This commit is contained in:
Justin M. Keyes 2019-02-17 10:54:00 +01:00 committed by GitHub
parent dc9dd8d664
commit 33ce70c883
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
29 changed files with 64 additions and 2911 deletions

View File

@ -250,20 +250,13 @@ CTRL-A command-line completion (see |cmdline-completion|)
CTRL-L command-line completion (see |cmdline-completion|)
*c_CTRL-_*
CTRL-_ a - switch between Hebrew and English keyboard mode, which is
CTRL-_ Switch between Hebrew and English keyboard mode, which is
private to the command-line and not related to hkmap.
This is useful when Hebrew text entry is required in the
command-line, searches, abbreviations, etc. Applies only if
the 'allowrevins' option is set.
See |rileft.txt|.
b - switch between Farsi and English keyboard mode, which is
private to the command-line and not related to fkmap. In
Farsi keyboard mode the characters are inserted in reverse
insert manner. This is useful when Farsi text entry is
required in the command-line, searches, abbreviations, etc.
See |farsi.txt|.
*c_CTRL-^*
CTRL-^ Toggle the use of language |:lmap| mappings and/or Input
Method.

View File

@ -8488,7 +8488,6 @@ eval Compiled with expression evaluation support. Always
ex_extra |+ex_extra|, always true now
extra_search Compiled with support for |'incsearch'| and
|'hlsearch'|
farsi Compiled with Farsi support |farsi|.
file_in_path Compiled with support for |gf| and |<cfile>|
filterpipe When 'shelltemp' is off pipes are used for shell
read/write/filter commands

View File

@ -1,208 +0,0 @@
*farsi.txt* Nvim
VIM REFERENCE MANUAL by Mortaza Ghassab Shiran
Right to Left and Farsi Mapping for Vim *farsi* *Farsi*
These functions have been made by Mortaza G. Shiran <shiran@jps.net>
Introduction
------------
In right-to-left oriented files the characters appear on the screen from right
to left. This kind of file is most useful when writing Farsi documents,
composing faxes or writing Farsi memos.
The commands, prompts and help files are not in Farsi, therefore the user
interface remains the standard Vi interface.
Highlights
----------
o Editing left-to-right files as in the original Vim, no change.
o Viewing and editing files in right-to-left windows. File orientation is
per window, so it is possible to view the same file in right-to-left and
left-to-right modes, simultaneously.
o Compatibility to the original Vim. Almost all features work in
right-to-left mode (see bugs below).
o Changing keyboard mapping and reverse insert modes using a single
command.
o Backing from reverse insert mode to the correct place in the file
(if possible).
o While in Farsi mode, numbers are entered from left to right. Upon entering
a none number character, that character will be inserted just into the
left of the last number.
o No special terminal with right-to-left capabilities is required. The
right-to-left changes are completely hardware independent. Only
Farsi font is necessary.
o Farsi keymapping on the command line in reverse insert mode.
o Toggling between left-to-right and right-to-left via F8 function key.
o Toggling between Farsi ISIR-3342 standard encoding and Vim Farsi via F9
function key. Since this makes sense only for the text written in
right-to-left mode, this function is also supported only in right-to-left
mode.
Usage
-----
Prior to starting Vim, the environment in which Vim can run in Farsi mode,
must be set. In addition to installation of Farsi fonts, following points
refer to some of the system environments, which you may need to set:
Key code mapping, loading graphic card in ASCII screen mode, setting the IO
driver in 8 bit clean mode ... .
o Setting the Farsi fonts
+ For Vim GUI set the 'guifont' to far-a01. This is done by entering
':set guifont=far-a01' in the Vim window.
You can have 'guifont' set to far-a01 by Vim during the Vim startup
by appending the ':set guifont=far-a01' into your vimrc file.
Under the X Window environment, you can also start Vim with the
'-fn far-a01' option.
+ For Vim within a xterm, start a xterm with the Farsi fonts (e.g.
kterm -fn far-a01). Then start Vim inside the kterm.
+ For Vim under DOS, prior to the first usage of Vim, upload the Farsi
fonts by executing the far-a01.com fonts uploading program.
o Farsi Keymapping Activation
To activate the Farsi keymapping, set either 'altkeymap' or 'fkmap'.
This is done by entering ':set akm' or ':set fk' in the Vim window.
You can have 'altkeymap' or 'fkmap' set as default by appending ':set akm'
or ':set fk' in your vimrc file.
To turn off the Farsi keymapping as a default second language keymapping,
reset the 'altkeymap' by entering ':set noakm'.
o right-to-left Farsi Mode
By default Vim starts in Left-to-right mode. Following are ways to change
the window orientation:
+ Start Vim with the -F option (e.g. vim -F ...).
+ Use the F8 function key to toggle between left-to-right and right-to-left.
+ While in Left-to-right mode, enter 'set rl' in the command line ('rl' is
the abbreviation for rightleft).
+ Put the 'set rl' line in your vimrc file to start Vim in right-to-left
mode permanently.
Encoding
--------
The letter encoding used is the Vim extended ISIR-3342 standard with a built
in function to convert between Vim extended ISIR-3342 and ISIR-3342 standard.
For document portability reasons, the letter encoding is kept the same across
different platforms (i.e. Unix, Windows, ...).
o Keyboard
+ CTRL-_ in insert/replace modes toggles between Farsi(akm)/Latin
mode as follows:
+ CTRL-_ moves the cursor to the end of the typed text in edit mode.
+ CTRL-_ in command mode only toggles keyboard mapping between Farsi(akm)/
Latin. The Farsi text is then entered in reverse insert mode.
+ F8 - Toggles between left-to-right and right-to-left.
+ F9 - Toggles the encoding between ISIR-3342 standard and Vim extended
ISIR-3342 (supported only in right-to-left mode).
+ Keyboard mapping is based on the Iranian ISIRI-2901 standard.
Following table shows the keyboard mapping while Farsi(akm) mode set:
-------------------------------------
` 1 2 3 4 5 6 7 8 9 0 - =
¢ ± ² ³ ´ µ ¶ · ¸ ¹ ° ­ ½
-------------------------------------
~ ! @ # $ % ^ & * ( ) _ +
~ £ § ® ¤ ¥ ª ¬ è ¨ © é «
-------------------------------------
q w e r t z u i o p [ ]
Ó Ò Æ Ù Ø Õ Ö à Ê É Ç ˆ
-------------------------------------
Q W E R T Z U I O P { }
÷ õ ô ó ò ý ð ö [ ] { }
-------------------------------------
a s d f g h j k l ; ' \
Ñ Ð á Ã Ü Á Å Þ Ý Ú Û ë
-------------------------------------
A S D F G H J K L : " |
ù û  þ ú ø À ü æ ç º » ê
-------------------------------------
< y x c v b n m , . /
¾ × Ô Î Í Ì Ë Ä ß ¦ ¯
-------------------------------------
> Y X C V B N M < > ?
¼ ñ Ô Ï Í ¡ Ë Â ¾ ¼ ¿
-------------------------------------
Note:
¡ stands for Farsi PSP (break without space)
¢ stands for Farsi PCN (for HAMZE attribute)
Restrictions
------------
o In insert/replace mode and fkmap (Farsi mode) set, CTRL-B is not
supported.
o If you change the character mapping between Latin/Farsi, the redo buffer
will be reset (emptied). That is, redo is valid and will function (using
'.') only within the mode you are in.
o While numbers are entered in Farsi mode, the redo buffer will be reset
(emptied). That is, you cannot redo the last changes (using '.') after
entering numbers.
o While in left-to-right mode and Farsi mode set, CTRL-R is not supported.
o While in right-to-left mode, the search on 'Latin' pattern does not work,
except if you enter the Latin search pattern in reverse.
o In command mode there is no support for entering numbers from left
to right and also for the sake of flexibility the keymapping logic is
restricted.
o Under the X Window environment, if you want to run Vim within a xterm
terminal emulator and Farsi mode set, you need to have an ANSI compatible
xterm terminal emulator. This is because the letter codes above 128 decimal
have certain meanings in the standard xterm terminal emulator.
Note: Under X Window environment, Vim GUI works fine in Farsi mode.
This eliminates the need of any xterm terminal emulator.
Bugs
----
While in insert/replace and Farsi mode set, if you repeatedly change the
cursor position (via cursor movement) and enter new text and then try to undo
the last change, the undo will lag one change behind. But as you continue to
undo, you will reach the original line of text. You can also use U to undo all
changes made in the current line.
For more information about the bugs refer to rileft.txt.
vim:tw=78:ts=8:noet:ft=help:norl:

View File

@ -137,7 +137,6 @@ Special issues ~
|mbyte.txt| multi-byte text support
|mlang.txt| non-English language support
|arabic.txt| Arabic language support and editing
|farsi.txt| Farsi (Persian) editing
|hebrew.txt| Hebrew language support and editing
|russian.txt| Russian language support and editing
|ft_ada.txt| Ada (the programming language) support

View File

@ -92,7 +92,7 @@ tag char action in Insert mode ~
|i_CTRL-]| CTRL-] trigger abbreviation
|i_CTRL-^| CTRL-^ toggle use of |:lmap| mappings
|i_CTRL-_| CTRL-_ When 'allowrevins' set: change language
(Hebrew, Farsi)
(Hebrew)
<Space> to '~' not used, except '0' and '^' followed by
CTRL-D
@ -1029,7 +1029,7 @@ tag command action in Command-line editing mode ~
|c_CTRL-]| CTRL-] trigger abbreviation
|c_CTRL-^| CTRL-^ toggle use of |:lmap| mappings
|c_CTRL-_| CTRL-_ when 'allowrevins' set: change language
(Hebrew, Farsi)
(Hebrew)
|c_<Del>| <Del> delete the character under the cursor
|c_<Left>| <Left> cursor left

View File

@ -561,17 +561,6 @@ A jump table for the options with a short description can be found at |Q_op|.
into reverse Insert mode, and don't know how to get out. See
'revins'.
*'altkeymap'* *'akm'* *'noaltkeymap'* *'noakm'*
'altkeymap' 'akm' boolean (default off)
global
When on, the second language is Farsi. In editing mode CTRL-_ toggles
the keyboard map between Farsi and English, when 'allowrevins' set.
When off, the keyboard map toggles between Hebrew and English. This
is useful to start the Vim in native mode i.e. English (left-to-right
mode) and have default second language Farsi or Hebrew (right-to-left
mode). See |farsi.txt|.
*'ambiwidth'* *'ambw'*
'ambiwidth' 'ambw' string (default: "single")
global
@ -2397,13 +2386,6 @@ A jump table for the options with a short description can be found at |Q_op|.
matter.
See the 'endofline' option.
*'fkmap'* *'fk'* *'nofkmap'* *'nofk'*
'fkmap' 'fk' boolean (default off) *E198*
global
When on, the keyboard is mapped for the Farsi character set.
Normally you would set 'allowrevins' and use CTRL-_ in insert mode to
toggle this option |i_CTRL-_|. See |farsi.txt|.
*'foldclose'* *'fcl'*
'foldclose' 'fcl' string (default "")
global
@ -4635,7 +4617,7 @@ A jump table for the options with a short description can be found at |Q_op|.
search "/" and "?" commands
This is useful for languages such as Hebrew, Arabic and Farsi.
This is useful for languages such as Hebrew and Arabic.
The 'rightleft' option must be set for 'rightleftcmd' to take effect.
*'ruler'* *'ru'* *'noruler'* *'noru'*

View File

@ -597,7 +597,6 @@ In Insert or Command-line mode:
Short explanation of each option: *option-list*
'aleph' 'al' ASCII code of the letter Aleph (Hebrew)
'allowrevins' 'ari' allow CTRL-_ in Insert and Command-line mode
'altkeymap' 'akm' for default second language (Farsi/Hebrew)
'ambiwidth' 'ambw' what to do with Unicode chars of ambiguous width
'autochdir' 'acd' change directory to the file in the current window
'arabic' 'arab' for Arabic as a default second language
@ -688,7 +687,6 @@ Short explanation of each option: *option-list*
'filetype' 'ft' type of file, used for autocommands
'fillchars' 'fcs' characters to use for displaying special items
'fixendofline' 'fixeol' make sure last line in file has <EOL>
'fkmap' 'fk' Farsi keyboard mapping
'foldclose' 'fcl' close a fold when the cursor leaves it
'foldcolumn' 'fdc' width of the column used to indicate folds
'foldenable' 'fen' set to display all folds open
@ -1122,7 +1120,6 @@ Context-sensitive completion on the command-line:
|-b| -b binary mode
|-l| -l lisp mode
|-A| -A Arabic mode ('arabic' is set)
|-F| -F Farsi mode ('fkmap' and 'rightleft' are set)
|-H| -H Hebrew mode ('hkmap' and 'rightleft' are set)
|-V| -V Verbose, give informative messages
|-r| -r give list of swap files

View File

@ -53,8 +53,7 @@ o No special terminal with right-to-left capabilities is required. The
o Many languages use and require right-to-left support. These languages
can quite easily be supported given the inclusion of their required
keyboard mappings and some possible minor code change. Some of the
current supported languages include - |arabic.txt|, |farsi.txt| and
|hebrew.txt|.
current supported languages include - |arabic.txt| and |hebrew.txt|.
Of Interest...

View File

@ -231,9 +231,6 @@ argument.
*-A*
-A Arabic mode. Sets the 'arabic' option on.
*-F*
-F Farsi mode. Sets the 'fkmap' and 'rightleft' options on.
*-H*
-H Hebrew mode. Sets the 'hkmap' and 'rightleft' options on.

View File

@ -330,7 +330,6 @@ N *+digraphs* |digraphs| *E196*
N *+eval* expression evaluation |eval.txt|
N *+ex_extra* always on now, used to be for Vim's extra Ex commands
N *+extra_search* |'hlsearch'| and |'incsearch'| options.
B *+farsi* |farsi| language
N *+file_in_path* |gf|, |CTRL-W_f| and |<cfile>|
N *+find_in_path* include file searches: |[I|, |:isearch|,
|CTRL-W_CTRL-I|, |:checkpath|, etc.

View File

@ -1141,12 +1141,6 @@ if has("rightleft")
call append("$", "hkmapp\tuse phonetic Hebrew keyboard mapping")
call <SID>BinOptionG("hkp", &hkp)
endif
if has("farsi")
call append("$", "altkeymap\tuse Farsi as the second language when 'revins' is set")
call <SID>BinOptionG("akm", &akm)
call append("$", "fkmap\tuse Farsi keyboard mapping")
call <SID>BinOptionG("fk", &fk)
endif
if has("arabic")
call append("$", "arabic\tprepare for editing Arabic text")
call append("$", "\t(local to window)")

View File

@ -1189,8 +1189,6 @@ struct window_S {
ScopeDictDictItem w_winvar; ///< Variable for "w:" dictionary.
dict_T *w_vars; ///< Dictionary with w: variables.
int w_farsi; /* for the window dependent Farsi functions */
/*
* The w_prev_pcmark field is used to check whether we really did jump to
* a new line after setting the w_pcmark. If not, then we revert to

View File

@ -14,7 +14,6 @@
#include "nvim/vim.h"
#include "nvim/ascii.h"
#include "nvim/charset.h"
#include "nvim/farsi.h"
#include "nvim/func_attr.h"
#include "nvim/indent.h"
#include "nvim/main.h"
@ -112,12 +111,6 @@ int buf_init_chartab(buf_T *buf, int global)
g_chartab[c++] = 1 + CT_PRINT_CHAR;
}
if (p_altkeymap) {
while (c < YE) {
g_chartab[c++] = 1 + CT_PRINT_CHAR;
}
}
while (c < 256) {
if (c >= 0xa0) {
// UTF-8: bytes 0xa0 - 0xff are printable (latin1)
@ -217,8 +210,7 @@ int buf_init_chartab(buf_T *buf, int global)
// "C".
if (!do_isalpha
|| mb_islower(c)
|| mb_isupper(c)
|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c)))) {
|| mb_isupper(c)) {
if (i == 0) {
// (re)set ID flag
if (tilde) {
@ -230,9 +222,7 @@ int buf_init_chartab(buf_T *buf, int global)
// (re)set printable
// For double-byte we keep the cell width, so
// that we can detect it from the first byte.
if (((c < ' ')
|| (c > '~')
|| (p_altkeymap && (F_isalpha(c) || F_isdigit(c))))) {
if (((c < ' ') || (c > '~'))) {
if (tilde) {
g_chartab[c] = (uint8_t)((g_chartab[c] & ~CT_CELL_MASK)
+ ((dy_flags & DY_UHEX) ? 4 : 2));
@ -540,8 +530,7 @@ char_u *transchar(int c)
c = K_SECOND(c);
}
if ((!chartab_initialized && (((c >= ' ') && (c <= '~'))
|| (p_altkeymap && F_ischar(c))))
if ((!chartab_initialized && (((c >= ' ') && (c <= '~'))))
|| ((c <= 0xFF) && vim_isprintc_strict(c))) {
// printable character
transchar_buf[i] = (char_u)c;

View File

@ -21,7 +21,6 @@
#include "nvim/eval/typval.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
@ -342,13 +341,7 @@ static void insert_enter(InsertState *s)
}
if (s->cmdchar == 'R') {
if (p_fkmap && p_ri) {
beep_flush();
EMSG(farsi_text_3); // encoded in Farsi
State = INSERT;
} else {
State = REPLACE;
}
State = REPLACE;
} else if (s->cmdchar == 'V' || s->cmdchar == 'v') {
State = VREPLACE;
s->replaceState = VREPLACE;
@ -630,10 +623,6 @@ static int insert_execute(VimState *state, int key)
s->c = hkmap(s->c); // Hebrew mode mapping
}
if (p_fkmap && KeyTyped) {
s->c = fkmap(s->c); // Farsi mode mapping
}
// Special handling of keys while the popup menu is visible or wanted
// and the cursor is still in the completed word. Only when there is
// a match, skip this when no matches were found.
@ -5344,7 +5333,6 @@ insertchar (
&& !ISSPECIAL(c)
&& MB_BYTE2LEN(c) == 1
&& i < INPUT_BUFLEN
&& !(p_fkmap && KeyTyped) // Farsi mode mapping moves cursor
&& (textwidth == 0
|| (virtcol += byte2cells(buf[i - 1])) < (colnr_T)textwidth)
&& !(!no_abbr && !vim_iswordc(c) && vim_iswordc(buf[i - 1]))) {
@ -7379,19 +7367,7 @@ static void ins_ctrl_(void)
undisplay_dollar();
} else
revins_scol = -1;
if (p_altkeymap) {
/*
* to be consistent also for redo command, using '.'
* set arrow_used to true and stop it - causing to redo
* characters entered in one mode (normal/reverse insert).
*/
arrow_used = TRUE;
(void)stop_arrow();
p_fkmap = curwin->w_p_rl ^ p_ri;
if (p_fkmap && p_ri)
State = INSERT;
} else
p_hkmap = curwin->w_p_rl ^ p_ri; /* be consistent! */
p_hkmap = curwin->w_p_rl ^ p_ri; // be consistent!
showmode();
}
@ -7444,12 +7420,6 @@ static bool ins_start_select(int c)
*/
static void ins_insert(int replaceState)
{
if (p_fkmap && p_ri) {
beep_flush();
EMSG(farsi_text_3); /* encoded in Farsi */
return;
}
set_vim_var_string(VV_INSERTMODE, ((State & REPLACE_FLAG) ? "i" :
replaceState == VREPLACE ? "v" :
"r"), 1);
@ -8423,12 +8393,10 @@ static bool ins_eol(int c)
if (virtual_active() && curwin->w_cursor.coladd > 0)
coladvance(getviscol());
if (p_altkeymap && p_fkmap)
fkmap(NL);
/* NL in reverse insert will always start in the end of
* current line. */
if (revins_on)
// NL in reverse insert will always start in the end of current line.
if (revins_on) {
curwin->w_cursor.col += (colnr_T)STRLEN(get_cursor_pos_ptr());
}
AppendToRedobuff(NL_STR);
bool i = open_line(FORWARD,

View File

@ -10667,7 +10667,6 @@ static void f_has(typval_T *argvars, typval_T *rettv, FunPtr fptr)
"eval", /* always present, of course! */
"ex_extra",
"extra_search",
"farsi",
"file_in_path",
"filterpipe",
"find_in_path",

View File

@ -30,7 +30,6 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
@ -3295,9 +3294,6 @@ static buf_T *do_sub(exarg_T *eap, proftime_T timeout,
delimiter = *cmd++; // remember delimiter character
has_second_delim = true;
} else { // find the end of the regexp
if (p_altkeymap && curwin->w_p_rl) {
lrF_sub(cmd);
}
which_pat = RE_LAST; // use last used regexp
delimiter = *cmd++; // remember delimiter character
pat = cmd; // remember start of search pat
@ -4298,9 +4294,6 @@ void ex_global(exarg_T *eap)
*cmd++ = NUL; /* replace it with a NUL */
}
if (p_altkeymap && curwin->w_p_rl)
lrFswap(pat,0);
if (search_regcomp(pat, RE_BOTH, which_pat, SEARCH_HIS, &regmatch) == FAIL) {
EMSG(_(e_invcmd));
return;

View File

@ -27,7 +27,6 @@
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/func_attr.h"
#include "nvim/getchar.h"
@ -221,7 +220,6 @@ static bool getln_interrupted_highlight = false;
#endif
static int cmd_hkmap = 0; // Hebrew mapping during command line
static int cmd_fkmap = 0; // Farsi mapping during command line
/// Internal entry point for cmdline mode.
///
@ -421,8 +419,6 @@ static uint8_t *command_line_enter(int firstc, long count, int indent)
cmdmsg_rl = false;
cmd_fkmap = 0;
ExpandCleanup(&s->xpc);
ccline.xpc = NULL;
@ -552,10 +548,6 @@ static int command_line_execute(VimState *state, int key)
s->c = hkmap(s->c);
}
if (cmd_fkmap) {
s->c = cmdl_fkmap(s->c);
}
if (cmdmsg_rl && !KeyStuffed) {
// Invert horizontal movements and operations. Only when
// typed by the user directly, not when the result of a
@ -1180,10 +1172,6 @@ static int command_line_handle_key(CommandLineState *s)
case K_DEL:
case K_KDEL:
case Ctrl_W:
if (cmd_fkmap && s->c == K_BS) {
s->c = K_DEL;
}
if (s->c == K_KDEL) {
s->c = K_DEL;
}
@ -1279,13 +1267,7 @@ static int command_line_handle_key(CommandLineState *s)
case K_INS:
case K_KINS:
// if Farsi mode set, we are in reverse insert mode -
// Do not change the mode
if (cmd_fkmap) {
beep_flush();
} else {
ccline.overstrike = !ccline.overstrike;
}
ccline.overstrike = !ccline.overstrike;
ui_cursor_shape(); // may show different cursor shape
return command_line_not_changed(s);
@ -1740,16 +1722,7 @@ static int command_line_handle_key(CommandLineState *s)
if (!p_ari) {
break;
}
if (p_altkeymap) {
cmd_fkmap = !cmd_fkmap;
if (cmd_fkmap) {
// in Farsi always in Insert mode
ccline.overstrike = false;
}
} else {
// Hebrew is default
cmd_hkmap = !cmd_hkmap;
}
cmd_hkmap = !cmd_hkmap;
return command_line_not_changed(s);
default:
@ -3217,40 +3190,40 @@ void put_on_cmdline(char_u *str, int len, int redraw)
msg_clr_eos();
msg_no_more = FALSE;
}
/*
* If we are in Farsi command mode, the character input must be in
* Insert mode. So do not advance the cmdpos.
*/
if (!cmd_fkmap) {
if (KeyTyped) {
m = Columns * Rows;
if (m < 0) /* overflow, Columns or Rows at weird value */
m = MAXCOL;
} else
if (KeyTyped) {
m = Columns * Rows;
if (m < 0) { // overflow, Columns or Rows at weird value
m = MAXCOL;
for (i = 0; i < len; ++i) {
c = cmdline_charsize(ccline.cmdpos);
/* count ">" for a double-wide char that doesn't fit. */
if (has_mbyte)
correct_cmdspos(ccline.cmdpos, c);
/* Stop cursor at the end of the screen, but do increment the
* insert position, so that entering a very long command
* works, even though you can't see it. */
if (ccline.cmdspos + c < m)
ccline.cmdspos += c;
if (has_mbyte) {
c = (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos) - 1;
if (c > len - i - 1)
c = len - i - 1;
ccline.cmdpos += c;
i += c;
}
++ccline.cmdpos;
}
} else {
m = MAXCOL;
}
for (i = 0; i < len; i++) {
c = cmdline_charsize(ccline.cmdpos);
// count ">" for a double-wide char that doesn't fit.
if (has_mbyte) {
correct_cmdspos(ccline.cmdpos, c);
}
// Stop cursor at the end of the screen, but do increment the
// insert position, so that entering a very long command
// works, even though you can't see it.
if (ccline.cmdspos + c < m) {
ccline.cmdspos += c;
}
if (has_mbyte) {
c = (*mb_ptr2len)(ccline.cmdbuff + ccline.cmdpos) - 1;
if (c > len - i - 1) {
c = len - i - 1;
}
ccline.cmdpos += c;
i += c;
}
ccline.cmdpos++;
}
if (redraw)
if (redraw) {
msg_check();
}
}
/*
@ -5999,37 +5972,12 @@ int hist_type2char(int type)
return NUL;
}
/*
* Write a character at the current cursor+offset position.
* It is directly written into the command buffer block.
*/
void cmd_pchar(int c, int offset)
{
if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0) {
EMSG(_("E198: cmd_pchar beyond the command length"));
return;
}
ccline.cmdbuff[ccline.cmdpos + offset] = (char_u)c;
ccline.cmdbuff[ccline.cmdlen] = NUL;
}
int cmd_gchar(int offset)
{
if (ccline.cmdpos + offset >= ccline.cmdlen || ccline.cmdpos + offset < 0) {
/* EMSG(_("cmd_gchar beyond the command length")); */
return NUL;
}
return (int)ccline.cmdbuff[ccline.cmdpos + offset];
}
/*
* Open a window on the current command line and history. Allow editing in
* the window. Returns when the window is closed.
* Returns:
* CR if the command is to be executed
* Ctrl_C if it is to be abandoned
* K_IGNORE if editing continues
*/
/// Open a window on the current command line and history. Allow editing in
/// the window. Returns when the window is closed.
/// Returns:
/// CR if the command is to be executed
/// Ctrl_C if it is to be abandoned
/// K_IGNORE if editing continues
static int open_cmdwin(void)
{
struct cmdline_info save_ccline;

File diff suppressed because it is too large Load Diff

View File

@ -1,174 +0,0 @@
/// @file farsi.h
///
/// Farsi characters are categorized into following types:
///
/// TyA (for capital letter representation)
/// TyB (for types that look like _X e.g. AYN)
/// TyC (for types that look like X_ e.g. YE_)
/// TyD (for types that look like _X_ e.g. _AYN_)
/// TyE (for types that look like X e.g. RE)
#ifndef NVIM_FARSI_H
#define NVIM_FARSI_H
#include "nvim/normal.h"
#include "nvim/types.h"
// Farsi character set definition
// Begin of the non-standard part
#define TEE_ 0x80
#define ALEF_U_H_ 0x81
#define ALEF_ 0x82
#define _BE 0x83
#define _PE 0x84
#define _TE 0x85
#define _SE 0x86
#define _JIM 0x87
#define _CHE 0x88
#define _HE_J 0x89
#define _XE 0x8a
#define _SIN 0x8b
#define _SHIN 0x8c
#define _SAD 0x8d
#define _ZAD 0x8e
#define _AYN 0x8f
#define _AYN_ 0x90
#define AYN_ 0x91
#define _GHAYN 0x92
#define _GHAYN_ 0x93
#define GHAYN_ 0x94
#define _FE 0x95
#define _GHAF 0x96
#define _KAF 0x97
#define _GAF 0x98
#define _LAM 0x99
#define LA 0x9a
#define _MIM 0x9b
#define _NOON 0x9c
#define _HE 0x9d
#define _HE_ 0x9e
#define _YE 0x9f
#define _IE 0xec
#define IE_ 0xed
#define IE 0xfb
#define _YEE 0xee
#define YEE_ 0xef
#define YE_ 0xff
// End of the non-standard part
// Standard part
#define F_BLANK 0xa0 // Farsi ' ' (SP) character
#define F_PSP 0xa1 // PSP for capitalizing of a character
#define F_PCN 0xa2 // PCN for redefining of the hamye meaning
#define F_EXCL 0xa3 // Farsi ! character
#define F_CURRENCY 0xa4 // Farsi Rial character
#define F_PERCENT 0xa5 // Farsi % character
#define F_PERIOD 0xa6 // Farsi '.' character
#define F_COMMA 0xa7 // Farsi ',' character
#define F_LPARENT 0xa8 // Farsi '(' character
#define F_RPARENT 0xa9 // Farsi ')' character
#define F_MUL 0xaa // Farsi 'x' character
#define F_PLUS 0xab // Farsi '+' character
#define F_BCOMMA 0xac // Farsi comma character
#define F_MINUS 0xad // Farsi '-' character
#define F_DIVIDE 0xae // Farsi divide (/) character
#define F_SLASH 0xaf // Farsi '/' character
#define FARSI_0 0xb0
#define FARSI_1 0xb1
#define FARSI_2 0xb2
#define FARSI_3 0xb3
#define FARSI_4 0xb4
#define FARSI_5 0xb5
#define FARSI_6 0xb6
#define FARSI_7 0xb7
#define FARSI_8 0xb8
#define FARSI_9 0xb9
#define F_DCOLON 0xba // Farsi ':' character
#define F_SEMICOLON 0xbb // Farsi ';' character
#define F_GREATER 0xbc // Farsi '>' character
#define F_EQUALS 0xbd // Farsi '=' character
#define F_LESS 0xbe // Farsi '<' character
#define F_QUESTION 0xbf // Farsi ? character
#define ALEF_A 0xc0
#define ALEF 0xc1
#define HAMZE 0xc2
#define BE 0xc3
#define PE 0xc4
#define TE 0xc5
#define SE 0xc6
#define JIM 0xc7
#define CHE 0xc8
#define HE_J 0xc9
#define XE 0xca
#define DAL 0xcb
#define ZAL 0xcc
#define RE 0xcd
#define ZE 0xce
#define JE 0xcf
#define SIN 0xd0
#define SHIN 0xd1
#define SAD 0xd2
#define ZAD 0xd3
#define _TA 0xd4
#define _ZA 0xd5
#define AYN 0xd6
#define GHAYN 0xd7
#define FE 0xd8
#define GHAF 0xd9
#define KAF 0xda
#define GAF 0xdb
#define LAM 0xdc
#define MIM 0xdd
#define NOON 0xde
#define WAW 0xdf
#define F_HE 0xe0 // F_ added for name clash with Perl
#define YE 0xe1
#define TEE 0xfc
#define _KAF_H 0xfd
#define YEE 0xfe
#define F_LBRACK 0xe2 // Farsi '[' character
#define F_RBRACK 0xe3 // Farsi ']' character
#define F_LBRACE 0xe4 // Farsi '{' character
#define F_RBRACE 0xe5 // Farsi '}' character
#define F_LQUOT 0xe6 // Farsi left quotation character
#define F_RQUOT 0xe7 // Farsi right quotation character
#define F_STAR 0xe8 // Farsi '*' character
#define F_UNDERLINE 0xe9 // Farsi '_' character
#define F_PIPE 0xea // Farsi '|' character
#define F_BSLASH 0xeb // Farsi '\' character
#define MAD 0xf0
#define JAZR 0xf1
#define OW 0xf2
#define MAD_N 0xf3
#define JAZR_N 0xf4
#define OW_OW 0xf5
#define TASH 0xf6
#define OO 0xf7
#define ALEF_U_H 0xf8
#define WAW_H 0xf9
#define ALEF_D_H 0xfa
// definitions for the window dependent functions (w_farsi).
#define W_CONV 0x1
#define W_R_L 0x2
// special Farsi text messages
extern const char_u farsi_text_1[];
extern const char_u farsi_text_2[];
extern const char_u farsi_text_3[];
extern const char_u farsi_text_5[];
#ifdef INCLUDE_GENERATED_DECLARATIONS
# include "farsi.h.generated.h"
#endif
#endif // NVIM_FARSI_H

View File

@ -25,7 +25,6 @@
#include "nvim/eval.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/farsi.h"
#include "nvim/func_attr.h"
#include "nvim/main.h"
#include "nvim/mbyte.h"
@ -2689,16 +2688,9 @@ do_map (
}
}
/*
* When in right-to-left mode and alternate keymap option set,
* reverse the character flow in the rhs in Farsi.
*/
if (p_altkeymap && curwin->w_p_rl)
lrswap(rhs);
/*
* check arguments and translate function keys
*/
//
// check arguments and translate function keys
//
if (haskey) {
len = (int)STRLEN(keys);
if (len > MAXMAPLEN) { /* maximum length of MAXMAPLEN chars */

View File

@ -424,16 +424,10 @@ int main(int argc, char **argv)
p_ut = 1;
}
if (curwin->w_p_rl && p_altkeymap) {
p_hkmap = FALSE; /* Reset the Hebrew keymap mode */
curwin->w_p_arab = FALSE; /* Reset the Arabic keymap mode */
p_fkmap = TRUE; /* Set the Farsi keymap mode */
}
/*
* Read in registers, history etc, from the ShaDa file.
* This is where v:oldfiles gets filled.
*/
//
// Read in registers, history etc, from the ShaDa file.
// This is where v:oldfiles gets filled.
//
if (*p_shada != NUL) {
shada_read_everything(NULL, false, true);
TIME_MSG("reading ShaDa");
@ -915,11 +909,6 @@ static void command_line_scan(mparm_T *parmp)
case 'f': { // "-f" GUI: run in foreground.
break;
}
case 'F': { // "-F" start in Farsi mode: rl + fkmap set.
p_fkmap = true;
set_option_value("rl", 1L, NULL, 0);
break;
}
case '?': // "-?" give help message (for MS-Windows)
case 'h': { // "-h" give help message
usage();

View File

@ -28,7 +28,6 @@
#include "nvim/ex_cmds2.h"
#include "nvim/ex_docmd.h"
#include "nvim/ex_getln.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
@ -340,8 +339,6 @@ static const struct nv_cmd {
{ K_F1, nv_help, NV_NCW, 0 },
{ K_XF1, nv_help, NV_NCW, 0 },
{ K_SELECT, nv_select, 0, 0 },
{ K_F8, farsi_f8, 0, 0 },
{ K_F9, farsi_f9, 0, 0 },
{ K_EVENT, nv_event, NV_KEEPREG, 0 },
{ K_COMMAND, nv_colon, 0, 0 },
};
@ -719,10 +716,6 @@ static void normal_get_additional_char(NormalState *s)
if (p_hkmap && lang && KeyTyped) {
*cp = hkmap(*cp);
}
// adjust Farsi mapped char
if (p_fkmap && lang && KeyTyped) {
*cp = fkmap(*cp);
}
}
// When the next character is CTRL-\ a following CTRL-N means the

View File

@ -3945,51 +3945,6 @@ static char *set_bool_option(const int opt_idx, char_u *const varp,
if (errmsg != NULL)
EMSG(_(errmsg));
}
} else if ((int *)varp == &p_altkeymap) {
if (old_value != p_altkeymap) {
if (!p_altkeymap) {
p_hkmap = p_fkmap;
p_fkmap = 0;
} else {
p_fkmap = p_hkmap;
p_hkmap = 0;
}
(void)init_chartab();
}
}
/*
* In case some second language keymapping options have changed, check
* and correct the setting in a consistent way.
*/
/*
* If hkmap or fkmap are set, reset Arabic keymapping.
*/
if ((p_hkmap || p_fkmap) && p_altkeymap) {
p_altkeymap = p_fkmap;
curwin->w_p_arab = FALSE;
(void)init_chartab();
}
/*
* If hkmap set, reset Farsi keymapping.
*/
if (p_hkmap && p_altkeymap) {
p_altkeymap = 0;
p_fkmap = 0;
curwin->w_p_arab = FALSE;
(void)init_chartab();
}
/*
* If fkmap set, reset Hebrew keymapping.
*/
if (p_fkmap && !p_altkeymap) {
p_altkeymap = 1;
p_hkmap = 0;
curwin->w_p_arab = FALSE;
(void)init_chartab();
}
if ((int *)varp == &curwin->w_p_arab) {
@ -4027,10 +3982,6 @@ static char *set_bool_option(const int opt_idx, char_u *const varp,
// Force-set the necessary keymap for arabic.
set_option_value("keymap", 0L, "arabic", OPT_LOCAL);
p_altkeymap = 0;
p_hkmap = 0;
p_fkmap = 0;
(void)init_chartab();
} else {
/*
* 'arabic' is reset, handle various sub-settings.
@ -5664,8 +5615,6 @@ void win_copy_options(win_T *wp_from, win_T *wp_to)
{
copy_winopt(&wp_from->w_onebuf_opt, &wp_to->w_onebuf_opt);
copy_winopt(&wp_from->w_allbuf_opt, &wp_to->w_allbuf_opt);
/* Is this right? */
wp_to->w_farsi = wp_from->w_farsi;
}
/*

View File

@ -464,8 +464,6 @@ EXTERN int p_hls; // 'hlsearch'
EXTERN long p_hi; // 'history'
EXTERN int p_hkmap; // 'hkmap'
EXTERN int p_hkmapp; // 'hkmapp'
EXTERN int p_fkmap; // 'fkmap'
EXTERN int p_altkeymap; // 'altkeymap'
EXTERN int p_arshape; // 'arabicshape'
EXTERN int p_icon; // 'icon'
EXTERN char_u *p_iconstring; // 'iconstring'

View File

@ -81,13 +81,6 @@ return {
varname='p_ari',
defaults={if_true={vi=false}}
},
{
full_name='altkeymap', abbreviation='akm',
type='bool', scope={'global'},
vi_def=true,
varname='p_altkeymap',
defaults={if_true={vi=false}}
},
{
full_name='ambiwidth', abbreviation='ambw',
type='string', scope={'global'},
@ -821,13 +814,6 @@ return {
varname='p_fixeol',
defaults={if_true={vi=true}}
},
{
full_name='fkmap', abbreviation='fk',
type='bool', scope={'global'},
vi_def=true,
varname='p_fkmap',
defaults={if_true={vi=false}}
},
{
full_name='foldclose', abbreviation='fcl',
type='string', list='onecomma', scope={'global'},

View File

@ -80,7 +80,6 @@
#include "nvim/ex_cmds2.h"
#include "nvim/ex_getln.h"
#include "nvim/edit.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/indent.h"
@ -6499,9 +6498,6 @@ int showmode(void)
if (p_hkmap) {
MSG_PUTS_ATTR(_(" Hebrew"), attr);
}
if (p_fkmap) {
MSG_PUTS_ATTR(farsi_text_5, attr);
}
if (State & LANGMAP) {
if (curwin->w_p_arab) {
MSG_PUTS_ATTR(_(" Arabic"), attr);

View File

@ -21,7 +21,6 @@
#include "nvim/ex_cmds.h"
#include "nvim/ex_cmds2.h"
#include "nvim/ex_getln.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/func_attr.h"
@ -1198,18 +1197,14 @@ int do_search(
}
}
if (p_altkeymap && curwin->w_p_rl)
lrFswap(searchstr,0);
c = searchit(curwin, curbuf, &pos, dirc == '/' ? FORWARD : BACKWARD,
searchstr, count, (spats[0].off.end * SEARCH_END
+ (options &
(SEARCH_KEEP + SEARCH_PEEK +
SEARCH_HIS
+ SEARCH_MSG + SEARCH_START
+ ((pat != NULL && *pat ==
';') ? 0 : SEARCH_NOOF)))),
RE_LAST, (linenr_T)0, tm);
searchstr, count,
(spats[0].off.end * SEARCH_END
+ (options
& (SEARCH_KEEP + SEARCH_PEEK + SEARCH_HIS + SEARCH_MSG
+ SEARCH_START
+ ((pat != NULL && *pat == ';') ? 0 : SEARCH_NOOF)))),
RE_LAST, (linenr_T)0, tm);
if (dircp != NULL)
*dircp = dirc; /* restore second '/' or '?' for normal_cmd() */
@ -2470,9 +2465,6 @@ static int cls(void)
int c;
c = gchar_cursor();
if (p_altkeymap && c == F_BLANK) {
return 0;
}
if (c == ' ' || c == '\t' || c == NUL) {
return 0;
}

View File

@ -1,133 +0,0 @@
" Simplistic testing of Farsi mode.
" Note: must be edited with latin1 encoding.
if !has('farsi') || has('nvim') " Not supported in Nvim. #6192
finish
endif
" Farsi uses a single byte encoding.
set enc=latin1
func Test_farsi_toggle()
new
set altkeymap
call assert_equal(0, &fkmap)
call assert_equal(0, &rl)
call feedkeys("\<F8>", 'x')
call assert_equal(1, &fkmap)
call assert_equal(1, &rl)
call feedkeys("\<F8>", 'x')
call assert_equal(0, &fkmap)
call assert_equal(0, &rl)
set rl
" conversion from Farsi 3342 to Farsi VIM.
call setline(1, join(map(range(0x80, 0xff), 'nr2char(v:val)'), ''))
call feedkeys("\<F9>", 'x')
let exp = [0xfc, 0xf8, 0xc1, 0xc3, 0xc4, 0xc5, 0xc6, 0xc7,
\ 0xc8, 0xc9, 0xca, 0xd0, 0xd1, 0xd2, 0xd3, 0xd6,
\ 0xd6, 0xd6, 0xd7, 0xd7, 0xd7, 0xd8, 0xd9, 0xda,
\ 0xdb, 0xdc, 0xdc, 0xc1, 0xdd, 0xde, 0xe0, 0xe0,
\ 0xe1, 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6,
\ 0xa7, 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae,
\ 0xaf, 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6,
\ 0xb7, 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe,
\ 0xbf, 0xc0, 0xc1, 0xc2, 0xc3, 0xc4, 0xc5, 0xc6,
\ 0xc7, 0xc8, 0xc9, 0xca, 0xcb, 0xcc, 0xcd, 0xce,
\ 0xcf, 0xd0, 0xd1, 0xd2, 0xd3, 0xd4, 0xd5, 0xd6,
\ 0xd7, 0xd8, 0xd9, 0xda, 0xdb, 0xdc, 0xdd, 0xde,
\ 0xdf, 0xe0, 0xe1, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6,
\ 0xe7, 0xe8, 0xe9, 0xea, 0xeb, 0xfb, 0xfb, 0xfe,
\ 0xfe, 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6,
\ 0xf7, 0xf8, 0xf9, 0xfa, 0xfb, 0xfc, 0xfd, 0xfe, 0xe1,
\ ]
call assert_equal(join(map(exp, 'nr2char(v:val)'), ''), getline(1))
" conversion from Farsi VIM to Farsi 3342.
call setline(1, join(map(range(0x80, 0xff), 'nr2char(v:val)'), ''))
call feedkeys("\<F9>", 'x')
let exp = [0xfc, 0xf8, 0xc1, 0x83, 0x84, 0x85, 0x86, 0x87,
\ 0x88, 0x89, 0x8a, 0x8b, 0x8c, 0x8d, 0x8e, 0x90,
\ 0x90, 0x90, 0x92, 0x93, 0x93, 0x95, 0x96, 0x97,
\ 0x98, 0xdc, 0x9a, 0x9b, 0x9c, 0x9e, 0x9e, 0xff,
\ 0xa0, 0xa1, 0xa2, 0xa3, 0xa4, 0xa5, 0xa6, 0xa7,
\ 0xa8, 0xa9, 0xaa, 0xab, 0xac, 0xad, 0xae, 0xaf,
\ 0xb0, 0xb1, 0xb2, 0xb3, 0xb4, 0xb5, 0xb6, 0xb7,
\ 0xb8, 0xb9, 0xba, 0xbb, 0xbc, 0xbd, 0xbe, 0xbf,
\ 0xc0, 0xc1, 0xc2, 0x83, 0x84, 0x85, 0x86, 0x87,
\ 0x88, 0x89, 0x8a, 0xcb, 0xcc, 0xcd, 0xce, 0xcf,
\ 0x8b, 0x8c, 0x8d, 0x8e, 0xd4, 0xd5, 0x90, 0x93,
\ 0x95, 0x96, 0x97, 0x98, 0x99, 0x9b, 0x9c, 0xdf,
\ 0x9d, 0xff, 0xe2, 0xe3, 0xe4, 0xe5, 0xe6, 0xe7,
\ 0xe8, 0xe9, 0xea, 0xeb, 0xec, 0xec, 0xee, 0xef,
\ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7,
\ 0xf8, 0xf9, 0xfa, 0xec, 0x80, 0xfd, 0xee, 0xff,
\ ]
call assert_equal(join(map(exp, 'nr2char(v:val)'), ''), getline(1))
bwipe!
endfunc
func Test_farsi_map()
new
set altkeymap
set rl
" RHS of mapping is reversed.
imap xyz abc
call feedkeys("axyz\<Esc>", 'tx')
call assert_equal('cba', getline(1))
set norl
iunmap xyz
set noaltkeymap
bwipe!
endfunc
func Test_input_farsi()
new
setlocal rightleft fkmap
" numbers switch input direction
call feedkeys("aabc0123456789.+-^%#=xyz\<Esc>", 'tx')
call assert_equal("\x8c旽蔭左重此虞項斑盛啪\x93<39>", getline('.'))
" all non-number special chars with spaces
call feedkeys("oB E F H I K L M O P Q R T U W Y ` ! @ # $ % ^ & * () - _ = + \\ | : \" . / < > ? \<Esc>", 'tx')
call assert_equal("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>[髗𦡆𦆭峁𦷜𣙷𧂭𨯂迚<F0A8AF82><E8BF9A><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>𣳇𧒆𠼻𧙖𥻗舚朌僙<E69C8C><E58399><EFBFBD><EFBFBD><EFBFBD>", getline('.'))
" all non-number special chars without spaces
call feedkeys("oBEFHIKLMOPQRTUWY`!@#$%^&*()-_=+\\|:\"./<>?\<Esc>",'tx')
call assert_equal("↑滙欉褅[]蘼襝蘘╯妙丰狀閮帛朣恨篝誚紋撚", getline('.'))
" all letter chars with spaces
call feedkeys("oa A b c C d D e f g G h i j J k l m n N o p q r s S t u v V w x X y z Z ; \ , [ ] \<Esc>", 'tx')
call assert_equal("<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>煢蟎臈<E89F8E>", getline('.'))
" all letter chars without spaces
call feedkeys("oaAbcCdDefgGhijJklmnNopqrsStuvVwxXyzZ;\,[]\<Esc>", 'tx')
call assert_equal("\x8c癵恘\x9f螰x86\x83媱縷x9d\x85\x80\x9c\x9b\x84佫\x8a\x89\x8e\x96\x8b餤x95\x90迋\x8d娵\x93淏\x97綅x87\x88", getline('.'))
bwipe!
endfunc
func Test_command_line_farsi()
set allowrevins altkeymap
" letter characters with spaces
call feedkeys(":\"\<C-_>a A b c C d D e f g G h i j J k l m n N o p q r s S t u v V w x X y z Z ; \\ , [ ]\<CR>", 'tx')
call assert_equal("\"\x88蟎煢𧙖㷛瑨瑨蟁覩覩趦眫眫涹𤀑𦍌㘵瓧<E398B5>螌詉貭貭畓憜㳑齐𦻑恷眤𤼎悤𦟌螩𦉫<E89EA9>蓚瓸譃䕢榲", getreg(':'))
" letter characters without spaces
call feedkeys(":\"\<C-_>aAbcCdDefgGhijJklmnNopqrsStuvVwxXyzZ;\\,[]\<CR>", 'tx')
call assert_equal("\"\x88\x87蜎祰惝x93娵\x8d迋\x90\x95餤x8b\x96\x8e\x89\x8a佫\x84\x9b\x9c\x80\x85\x9d霞鄃x83\x86螰x9f玴泂\x8c", getreg(':'))
" other characters with spaces
call feedkeys(":\"\<C-_>0 1 2 3 4 5 6 7 8 9 ` . ! \" $ % ^ & / () = \\ ? + - _ * : # ~ @ < > { } | B E F H I K L M O P Q R T U W Y\<CR>", 'tx')
call assert_equal("\"<22><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>]惽覉删䭾𠃮脃嬟𨨏嵗𥻗栂𣏵聢聛𡵆㗒矾舚㰘𣳇<E3B098>𠼻<EFBFBD><F0A0BCBB><EFBFBD><EFBFBD><EFBFBD>䁥阸<E481A5>𨸹朌<F0A8B8B9><E69C8C>僙𨯂覔瓲甅絍聣聦稭糚𥼚糂", getreg(':'))
" other characters without spaces
call feedkeys(":\"\<C-_>0123456789`.!\"$%^&/()=\\?+-_*:#~@<>{}|BEFHIKLMOPQRTUWY\<CR>", 'tx')
call assert_equal("\"嚬貗齀][釐翫盪禲瞕{撫坍捏鴇重辨蔗辛洩奶誨弛兢毓絕陴掠", getreg(':'))
set noallowrevins noaltkeymap
endfunc

View File

@ -20,7 +20,6 @@
#include "nvim/ex_docmd.h"
#include "nvim/ex_eval.h"
#include "nvim/ex_getln.h"
#include "nvim/farsi.h"
#include "nvim/fileio.h"
#include "nvim/fold.h"
#include "nvim/getchar.h"
@ -2934,10 +2933,6 @@ void win_init_empty(win_T *wp)
wp->w_topline = 1;
wp->w_topfill = 0;
wp->w_botline = 2;
if (wp->w_p_rl)
wp->w_farsi = W_CONV + W_R_L;
else
wp->w_farsi = W_CONV;
wp->w_s = &wp->w_buffer->b_s;
}