7. The Menus / 7.3 Functions in the View Menu
Fit to Selection Width adjusts the zoom factor, so that the full width of the selected layers fits in the window. This is especially useful for editing text layers.
Whether or not the window size will be adjusted, can be set in Options/Display, page Document (see chapter 7.10.1.26). By holding Shift the behavior of the size adjustment will be inverted.