Only edit or preview if it's a file, not a directory