added back check for Null Grammar when new file has no selection.
leaving Plain Text in case of selection or autoselected to that type.