Copy from http://www.scintilla.org