Browse Source

Fix check for continuation byte in core/text/text_edit

Clay Murray 2 years ago
parent
commit
02eab95dd1
1 changed files with 2 additions and 2 deletions
  1. 2 2
      core/text/edit/text_edit.odin

+ 2 - 2
core/text/edit/text_edit.odin

@@ -219,7 +219,7 @@ selection_delete :: proc(s: ^State) {
 
 
 translate_position :: proc(s: ^State, pos: int, t: Translation) -> int {
 translate_position :: proc(s: ^State, pos: int, t: Translation) -> int {
 	is_continuation_byte :: proc(b: byte) -> bool {
 	is_continuation_byte :: proc(b: byte) -> bool {
-		return b <= 0x80 && b < 0xc0
+		return b >= 0x80 && b < 0xc0
 	}
 	}
 	is_space :: proc(b: byte) -> bool {
 	is_space :: proc(b: byte) -> bool {
 		return b == ' ' || b == '\t' || b == '\n'
 		return b == ' ' || b == '\t' || b == '\n'
@@ -410,4 +410,4 @@ perform_command :: proc(s: ^State, cmd: Command) {
 	case .Select_Line_Start: select_to(s, .Soft_Line_Start)
 	case .Select_Line_Start: select_to(s, .Soft_Line_Start)
 	case .Select_Line_End:   select_to(s, .Soft_Line_End)
 	case .Select_Line_End:   select_to(s, .Soft_Line_End)
 	}
 	}
-}
+}