Very slowly editing

I am learning the rstudio, I try to edit in an R script a program of 2 or three commands and in many cases the application do not let me edit. I sometimes just write the code and the editor stop showing the code I write and after 10-15 seconds it show all what I wrote. It is very frustrating - cannot learn like this