comparison src/insdel.c @ 23203:a4e688757109

(count_combining_after): Check also preceding bytes at POS if all characters in STRING are not character head.
author Kenichi Handa <handa@m17n.org>
date Mon, 07 Sep 1998 13:39:15 +0000
parents 8d75946934cf
children 42fcd022d4e5
comparison
equal deleted inserted replaced
23202:750deb2c6c0b 23203:a4e688757109
948 if (NILP (current_buffer->enable_multibyte_characters)) 948 if (NILP (current_buffer->enable_multibyte_characters))
949 return 0; 949 return 0;
950 if (length == 0 || ASCII_BYTE_P (string[length - 1])) 950 if (length == 0 || ASCII_BYTE_P (string[length - 1]))
951 return 0; 951 return 0;
952 i = length - 1; 952 i = length - 1;
953 while (i > 0 && ! CHAR_HEAD_P (string[i])) 953 while (i >= 0 && ! CHAR_HEAD_P (string[i]))
954 { 954 {
955 i--; 955 i--;
956 } 956 }
957 if (! BASE_LEADING_CODE_P (string[i])) 957 if (i < 0)
958 {
959 /* All characters in `string' are not character head.
960 We must check also preceding bytes at POS.
961 We are sure that the gap is at POS. */
962 string = BEG_ADDR;
963 i = pos_byte - 2;
964 while (i >= 0 && ! CHAR_HEAD_P (string[i]))
965 i--;
966 if (i < 0 || !BASE_LEADING_CODE_P (string[i]))
967 return 0;
968 }
969 else if (!BASE_LEADING_CODE_P (string[i]))
958 return 0; 970 return 0;
959 971
960 if (pos == ZV) 972 if (pos == ZV)
961 return 0; 973 return 0;
962 c = FETCH_BYTE (pos_byte); 974 c = FETCH_BYTE (pos_byte);