This command can be accessed from an image menubar as
-> ."Crop Layer" crops the active layer, only, to the selection bounds, by removing any strips at the edges whose contents are all completely unselected. Areas that are partially selected (for example, by feathering) are not cropped away. If no selection exists for the layer, the menu entry will be insensitive.