complete editor function