The following question came up during a Magma calculation:
Suppose that $\mathfrak g$ is a finite-dimensional Lie algebra over $\mathbf C$ and $\mathfrak k \subset \mathfrak g$ a subalgebra of codimension one. Suppose that $\mathfrak k$ is isomorphic to $\mathfrak{sl}_n(\mathbf C)$. Does it follow that $\mathfrak g$ is isomorphic to $\mathfrak {gl}_n(\mathbf C)$?
$\mathfrak g$ is a $\mathfrak{sl}_n$-module (via the adjoint action), $\mathfrak k=\mathfrak{sl}_n$ is a submodule, take its complement, which is a 1-dimensional module, so it must be trivial. As a result, $\mathfrak g$ is (as a Lie algebra) the direct sum of $\mathfrak{sl}_n$ and of $\mathbb{C}$, i.e. the answer is yes.