cherry-pick [composition] Add composition mode markers

Issue #1513

cherry-pick 41a6dbccd9ca3334d618c3837ea40796233c7d84 from jessegrosjean / CodeMirror