Right now the used registerSize needs to be passes as parameter to CodeEditor.finishEditing(). This should be calculated instead to make editing easier.
In general its not that difficult to do, but you need to take cat 2 (long / double) values into account which use 2 registers.