Rearrange codes in linenoise.c
Use enum to represent all of keying action