Automatically trim MIDI clip while MIDI recording deleting areas with no MIDI events

When MIDI recording and snap to grid is active there always is one bar tail in MIDI clip with no MIDI events. And very often one bar with no MIDI events in the beginning of MIDI clip. I trim them manually to avoid overlaps and for to have better overview of arrange. Is it possible to do it automatically “on the fly” while MIDI recording? I mean to delete areas in MIDI clip at the edges that contain no MIDI events.