skip to Main Content

That’s all, sometimes I miss I could do that while working on different parts of a kinda long script or whatever… So I think it’d be nice if, as we can do in a spread sheet by fixing a row for example, we could quickly define certain part of the code we want always visible and then can scroll to any other part of the script while still being able to see such "fixed" lines of code as a reference, copy, etc.

It seemed to me that it could be an already existing feature, but I’ve been not able to find anything… not even an extension, but maybe someone here knows? Well, I hope it makes sense and thanks in advance!

2

Answers


  1. Hard to guess for how large "sticky" portion of code you are actually aiming, but if it is just, say, function "signature line" or nesting header in general, you may try experimental "Editor sticky scroll" (editor.experimental.stickyScroll.enabled) feature that was just released in VSC v1.70:

    https://code.visualstudio.com/updates/v1_70#_editor-sticky-scroll

    Visual Studio Code document area with breadcrumb and TypeScript class with nested function scrolling; while bodies of functions slides under top border of the editor, lines where functions and classes start remains "stuck" until their ending bracket reaches them during scrolling and only then they leave the viewport.

    Login or Signup to reply.
  2. How about spliting the editor?

    enter image description here

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search