Ignore first modified event in config editor

This event comes from initially setting the text for the current
config value on the editor and was causing the config to be
immediately saved multiple times when opened.
This commit is contained in:
Kevin Sawicki
2013-04-30 21:55:43 -07:00
parent ca7da8a0da
commit 047d9525e7
2 changed files with 16 additions and 2 deletions

View File

@@ -48,5 +48,6 @@ class ConfigPanel extends View
value ?= ""
editor.setText(value.toString())
editor.getBuffer().on 'contents-modified', =>
config.set(name, @parseValue(type, editor.getText()))
editor.getBuffer().one 'contents-modified', =>
editor.getBuffer().on 'contents-modified', =>
config.set(name, @parseValue(type, editor.getText()))