The Enter key handling was completely broken so the only goal Tommy and I had at that time was to fix it once and forever and leave any optimization for next iteration. Moreover as it's an Enter key event, not a cursor move for instance, it means the code itself is called at very low frequency. I'm going to apply your suggestion anyway as it's simple and shouldn't affect overall PR. Thanks!