Browse Source

text/edit: fix undo_state_push wrong builder check

Laytan Laats 1 year ago
parent
commit
c9b69d76b0
1 changed files with 1 additions and 1 deletions
  1. 1 1
      core/text/edit/text_edit.odin

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

@@ -137,7 +137,7 @@ clear_all :: proc(s: ^State) -> (cleared: bool) {
 
 
 // push current text state to the wanted undo|redo stack
 // push current text state to the wanted undo|redo stack
 undo_state_push :: proc(s: ^State, undo: ^[dynamic]^Undo_State) -> mem.Allocator_Error {
 undo_state_push :: proc(s: ^State, undo: ^[dynamic]^Undo_State) -> mem.Allocator_Error {
-	if s.builder != nil {
+	if s.builder == nil {
 		return nil
 		return nil
 	}
 	}
 	text := string(s.builder.buf[:])
 	text := string(s.builder.buf[:])