The outcome of cmd+z is totally unpredictable, at least with Chinese text, sometimes it rolls back a word with a couple of characters, sometimes it rolls back a whole sentence. I’m not sure if it is the case with other languages.
Does it work any different than TextEdit, the free simple editor installed with the Mac? It should be the same. For me, there is a variable (and essentially unpredictable) quantity to how much is undone at once. It has to do with typing duration: if you type twenty words without doing anything else and press Cmd-Z, all twenty words should be removed. But, if you type three words, then click back a word and add one in between the first two, for a total of four, then Cmd-Z will remove only the last inserted word, and if you press it again, then the original three words will be removed.