comparison src/edit.c @ 15850:a6ca8cf07a98 v8.1.0932

patch 8.1.0932: Farsi support is outdated and unused commit https://github.com/vim/vim/commit/14184a3133b9a6ee5f711d493c04e41ba4fa7c2f Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 16 15:10:30 2019 +0100 patch 8.1.0932: Farsi support is outdated and unused Problem: Farsi support is outdated and unused. Solution: Delete the Farsi support.
author Bram Moolenaar <Bram@vim.org>
date Sat, 16 Feb 2019 15:15:07 +0100
parents 56be1282994f
children 7fad90423bd2
comparison
equal deleted inserted replaced
15849:c478f5603556 15850:a6ca8cf07a98
465 } 465 }
466 } 466 }
467 467
468 if (cmdchar == 'R') 468 if (cmdchar == 'R')
469 { 469 {
470 #ifdef FEAT_FKMAP
471 if (p_fkmap && p_ri)
472 {
473 beep_flush();
474 emsg(farsi_text_3); /* encoded in Farsi */
475 State = INSERT;
476 }
477 else
478 #endif
479 State = REPLACE; 470 State = REPLACE;
480 } 471 }
481 else if (cmdchar == 'V' || cmdchar == 'v') 472 else if (cmdchar == 'V' || cmdchar == 'v')
482 { 473 {
483 State = VREPLACE; 474 State = VREPLACE;
809 did_cursorhold = TRUE; 800 did_cursorhold = TRUE;
810 801
811 #ifdef FEAT_RIGHTLEFT 802 #ifdef FEAT_RIGHTLEFT
812 if (p_hkmap && KeyTyped) 803 if (p_hkmap && KeyTyped)
813 c = hkmap(c); /* Hebrew mode mapping */ 804 c = hkmap(c); /* Hebrew mode mapping */
814 #endif
815 #ifdef FEAT_FKMAP
816 if (p_fkmap && KeyTyped)
817 c = fkmap(c); /* Farsi mode mapping */
818 #endif 805 #endif
819 806
820 #ifdef FEAT_INS_EXPAND 807 #ifdef FEAT_INS_EXPAND
821 /* 808 /*
822 * Special handling of keys while the popup menu is visible or wanted 809 * Special handling of keys while the popup menu is visible or wanted
6279 */ 6266 */
6280 while ( (c = vpeekc()) != NUL 6267 while ( (c = vpeekc()) != NUL
6281 && !ISSPECIAL(c) 6268 && !ISSPECIAL(c)
6282 && (!has_mbyte || MB_BYTE2LEN_CHECK(c) == 1) 6269 && (!has_mbyte || MB_BYTE2LEN_CHECK(c) == 1)
6283 && i < INPUT_BUFLEN 6270 && i < INPUT_BUFLEN
6284 # ifdef FEAT_FKMAP
6285 && !(p_fkmap && KeyTyped) /* Farsi mode mapping moves cursor */
6286 # endif
6287 && (textwidth == 0 6271 && (textwidth == 0
6288 || (virtcol += byte2cells(buf[i - 1])) < (colnr_T)textwidth) 6272 || (virtcol += byte2cells(buf[i - 1])) < (colnr_T)textwidth)
6289 && !(!no_abbr && !vim_iswordc(c) && vim_iswordc(buf[i - 1]))) 6273 && !(!no_abbr && !vim_iswordc(c) && vim_iswordc(buf[i - 1])))
6290 { 6274 {
6291 #ifdef FEAT_RIGHTLEFT 6275 #ifdef FEAT_RIGHTLEFT
8404 revins_chars = 0; 8388 revins_chars = 0;
8405 undisplay_dollar(); 8389 undisplay_dollar();
8406 } 8390 }
8407 else 8391 else
8408 revins_scol = -1; 8392 revins_scol = -1;
8409 #ifdef FEAT_FKMAP 8393 p_hkmap = curwin->w_p_rl ^ p_ri; // be consistent!
8410 if (p_altkeymap)
8411 {
8412 /*
8413 * to be consistent also for redo command, using '.'
8414 * set arrow_used to true and stop it - causing to redo
8415 * characters entered in one mode (normal/reverse insert).
8416 */
8417 arrow_used = TRUE;
8418 (void)stop_arrow();
8419 p_fkmap = curwin->w_p_rl ^ p_ri;
8420 if (p_fkmap && p_ri)
8421 State = INSERT;
8422 }
8423 else
8424 #endif
8425 p_hkmap = curwin->w_p_rl ^ p_ri; /* be consistent! */
8426 showmode(); 8394 showmode();
8427 } 8395 }
8428 #endif 8396 #endif
8429 8397
8430 /* 8398 /*
8486 * <Insert> key in Insert mode: toggle insert/replace mode. 8454 * <Insert> key in Insert mode: toggle insert/replace mode.
8487 */ 8455 */
8488 static void 8456 static void
8489 ins_insert(int replaceState) 8457 ins_insert(int replaceState)
8490 { 8458 {
8491 #ifdef FEAT_FKMAP 8459 #ifdef FEAT_EVAL
8492 if (p_fkmap && p_ri)
8493 {
8494 beep_flush();
8495 emsg(farsi_text_3); /* encoded in Farsi */
8496 return;
8497 }
8498 #endif
8499
8500 # ifdef FEAT_EVAL
8501 set_vim_var_string(VV_INSERTMODE, 8460 set_vim_var_string(VV_INSERTMODE,
8502 (char_u *)((State & REPLACE_FLAG) ? "i" 8461 (char_u *)((State & REPLACE_FLAG) ? "i"
8503 : replaceState == VREPLACE ? "v" 8462 : replaceState == VREPLACE ? "v"
8504 : "r"), 1); 8463 : "r"), 1);
8505 # endif 8464 #endif
8506 ins_apply_autocmds(EVENT_INSERTCHANGE); 8465 ins_apply_autocmds(EVENT_INSERTCHANGE);
8507 if (State & REPLACE_FLAG) 8466 if (State & REPLACE_FLAG)
8508 State = INSERT | (State & LANGMAP); 8467 State = INSERT | (State & LANGMAP);
8509 else 8468 else
8510 State = replaceState | (State & LANGMAP); 8469 State = replaceState | (State & LANGMAP);
9914 * CTRL-O). */ 9873 * CTRL-O). */
9915 if (virtual_active() && curwin->w_cursor.coladd > 0) 9874 if (virtual_active() && curwin->w_cursor.coladd > 0)
9916 coladvance(getviscol()); 9875 coladvance(getviscol());
9917 9876
9918 #ifdef FEAT_RIGHTLEFT 9877 #ifdef FEAT_RIGHTLEFT
9919 # ifdef FEAT_FKMAP
9920 if (p_altkeymap && p_fkmap)
9921 fkmap(NL);
9922 # endif
9923 /* NL in reverse insert will always start in the end of 9878 /* NL in reverse insert will always start in the end of
9924 * current line. */ 9879 * current line. */
9925 if (revins_on) 9880 if (revins_on)
9926 curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor()); 9881 curwin->w_cursor.col += (colnr_T)STRLEN(ml_get_cursor());
9927 #endif 9882 #endif