i just feel that may be ur going through some mental agony or stress
regarding some matter and hence developed gastritis
symptoms when u eat something due to gas accumulation..and moreover your sleep disturbance also point towards the same thing..
u just need to relax and take your diet at regular times with little spices and better drink warm milk before going to bed and even eat atleast 3 hrs before going to bed at night..
u wil definitely overcome your problem if u do this with a relaxed mind..
all the best ..