comparison src/mbyte.c @ 16066:473fbdb2717c v8.1.1038

patch 8.1.1038: Arabic support excludes Farsi commit https://github.com/vim/vim/commit/dc4fa190e7b9d6ba49416ce875d2192c4444d3eb Author: Bram Moolenaar <Bram@vim.org> Date: Fri Mar 22 16:33:15 2019 +0100 patch 8.1.1038: Arabic support excludes Farsi Problem: Arabic support excludes Farsi. Solution: Add Farsi support to the Arabic support. (Ali Gholami Rudi, Ameretat Reith)
author Bram Moolenaar <Bram@vim.org>
date Fri, 22 Mar 2019 16:45:05 +0100
parents 7fad90423bd2
children 304283d2a772
comparison
equal deleted inserted replaced
16065:6efba76095c9 16066:473fbdb2717c
1909 *pp += (*mb_ptr2len)(*pp); 1909 *pp += (*mb_ptr2len)(*pp);
1910 return c; 1910 return c;
1911 } 1911 }
1912 1912
1913 #if defined(FEAT_ARABIC) || defined(PROTO) 1913 #if defined(FEAT_ARABIC) || defined(PROTO)
1914 /*
1915 * Check whether we are dealing with Arabic combining characters.
1916 * Note: these are NOT really composing characters!
1917 */
1918 int
1919 arabic_combine(
1920 int one, /* first character */
1921 int two) /* character just after "one" */
1922 {
1923 if (one == a_LAM)
1924 return arabic_maycombine(two);
1925 return FALSE;
1926 }
1927
1928 /*
1929 * Check whether we are dealing with a character that could be regarded as an
1930 * Arabic combining character, need to check the character before this.
1931 */
1932 int
1933 arabic_maycombine(int two)
1934 {
1935 if (p_arshape && !p_tbidi)
1936 return (two == a_ALEF_MADDA
1937 || two == a_ALEF_HAMZA_ABOVE
1938 || two == a_ALEF_HAMZA_BELOW
1939 || two == a_ALEF);
1940 return FALSE;
1941 }
1942
1943 /* 1914 /*
1944 * Check if the character pointed to by "p2" is a composing character when it 1915 * Check if the character pointed to by "p2" is a composing character when it
1945 * comes after "p1". For Arabic sometimes "ab" is replaced with "c", which 1916 * comes after "p1". For Arabic sometimes "ab" is replaced with "c", which
1946 * behaves like a composing character. 1917 * behaves like a composing character.
1947 */ 1918 */