This work presents an extension of exfernal mode theory where the effects of edge magnetic shear and plasma separatrix are investigated., from which a set of three coupled differential equations describing the dispersion relation are derived. To correctly assess the effect of edge shear on exfernal modes, higher order corrections need to be retained in the expansion of the safety factor around the rational surface. The equations are solved numerically for equilibrium pressure and safety factor profiles containing the key features for the excitation of exfernal modes, including a model of a plasma separatrix. The current-driven branch of the instability is significantly reduced by the inclusion of the separatrix, but the mode remains unstable through coupling with the pressure-driven infernal drive. The obtained parameter space for the instability without the effect of the separatrix is compared with the growth rates calculated using the KINX code, and with the nonlinear plasma displacement calculated using the VMEC free-boundary code. From the comparison it was found that the edge shear can be of order unity and still excite exfernal modes, implying that EHOs can be excited even with weak flattening of the local safety factor at the edge, which is in line with some current experimental observations, but contrary to previous simpler analytic theory.