Current implementation always says that first 5 lines of code is shown when selected code does not fully fit into its window. This is not correct as the window can be resized, may have a header occupying one line, and the lines may not be the first ones. Also the wording is awkward. Correct these issues by checking current window height, accounting for the potential header presence by checking sidebar.enabled config flag, and updating the message format to be more concise: " Selected Code (4/15 lines)" While at it switch to using Utils.count_lines() which does not need creating temporary tables. Note that this does not deal with the header info being stale after resizing sidebar windows.
106 KiB
106 KiB