Cache last used layer_id for StackingOrder (#4211)

This optimizes rendering time by saving computation of the layer_id and
comparison when inserting it into the `BTreeMaps`.


![layer_id_caching](https://github.com/zed-industries/zed/assets/1185253/2944fa3d-586b-4a9a-9dfc-0acf59b77402)

Release Notes:

- Improved rendering performance when a lot of text is being displayed.
accb4f8756Thorsten Ball committed on 1/23/2024, 10:58:37 AM· committed by GitHubparents5a9f1e4bf843e2
1 file changedLine totals unavailable