I often find myself scrolling up in a code file to see which context I am in (class/method definition, yaml-key, etc). It would be super handy if I could somehow "freeze" the last lines of each indentation level that's lower than the last currently visible line.
For example:
class X:
def a():
# ...
def b():
# ...
def some_local_function():
# lots of code
# ---- this is last line visible in the buffer/window
# more visible code
In this case I would like the window to look like this:
class X:
def b():
def some_local_function():
# some demarcation to indicate the lines above are separate from those below
# ---- this is last line visible in the window
# more visible code
Is there already a way to do this? If not, how would I go about implementing it?