Microsoft/vscode

Option for sticky scroll to prioritize inner blocks

Open

#208.406 aberto em 22 de mar. de 2024

Ver no GitHub
 (9 comments) (18 reactions) (2 assignees)TypeScript (10.221 forks)batch import
editor-sticky-scrollfeature-requesthelp wanted

Métricas do repositório

Stars
 (74.848 stars)
Métricas de merge de PR
 (Mesclagem média 11h 43m) (1.000 fundiu PRs em 30d)

Description

Currently sticky scroll always stick the first lines, which may make it less useful in some situations.

Consider the following case:

<!DOCTYPE html>
<html>
    <body>
        <script>
            class SomeClass {
                constructor() {
                    // Long & complicated code
                    // Long & complicated code
                    // Long & complicated code
                }
            }
        </script>
    </body>
</html>

If we scroll to the comments with a max line count set to 3 for sticky scroll, <html>, <body> and <script> will stick around. However, we might not want to always stare at <html> whenever we write HTML, so it may be better to let <html> make room for inner code blocks.

Current Suggested alternative
"<html>", "<body>" and "<script>" stuck around, as they normally would It might be better if "<script>", "class SomeClass {", and "constructor() {" stuck around instead.

This problem also applies to other languages with a complicated program structure. Adding such an option can sometimes make it more efficient to work with these languages.

Guia do colaborador