CMD command history – complete block of code

When I type multiline expression, for example when programming on CLI, I only get one line at the time of history when pressing arrow up (or pressing F7).
When trying some programming-snippets, I want the complete inserted block of code and not line by line.

Any solution for that?