Within a frame, only one object can contain the keyboard focus. This property must be maintained when a frame contains multiple buffers in multiple views, and when a single buffer contains other buffers as items.
When a buffer is active, it will usually display the current selection, or a line indicating the insertion point; this line is called the caret. Keyboard focus is a matter of caret ownership: only the the buffer which has the keyboard focus can display a caret.
When a buffer contains other buffers, it keeps track of caret ownership among the sub-buffers it contains. When the caret is taken away from the main buffer, it will take away caret ownership from the appropriate sub-buffer, etc.
When a buffer or snip is draw, an argument to the drawing method specifies whether the caret should be drawn with the data. This argument can be any of (in increasing order):