I've found that this problem appears to depend on the window size. With the default window size, everything works as expected. But, when I maximize the window to fill my screen, C-p moves two lines up. Does that happen for you? If not, I can experiment to find more precise conditions.

code.el is the same as the previous report, yes.