Shouldn't this values be retrieved before refreshing the editor? It certainly seems to produce a better behavior...