Git Product home page Git Product logo

Comments (16)

wellle avatar wellle commented on May 22, 2024 5

Thanks for the interest in this everyone! I did some work on this yesterday. I'm basically starting again because there's some big differences after #22 had been merged.

The non filtered version is fairly similar to before (branch 10-cursor-line).

But the filtered version (branch 10-cursor-line-filtered) turns out to be more challenging. I'll need some more time to decide if a simple approach will be enough (might be slightly misleading in some cases).

And I still haven't decided if I want to support one of them or both of these variations. To me personally the filtered one seems more visually appealing, but is harder to get right on my end.

So yeah, I'll get back to this eventually. โœŒ๏ธ

from context.vim.

wellle avatar wellle commented on May 22, 2024 4

@typhooncamel @jclifford-zd: I pushed a branch which should do what you asked for: https://github.com/wellle/context.vim/compare/10-cursor-line

Can you please use that for a bit and let me know if that's really what you want? In that case I might add a setting to enable this behavior. Thanks!

from context.vim.

wmusial avatar wmusial commented on May 22, 2024 4

thanks @wellle , your custom branch 10-cursor-line-filtered is exactly what i was looking for.

I feel that the "cursor-line-filtered` is really the primary use case of this plugin.
Consider what happens when one is editing the line under the cursor, and starts wondering about its context. I start scanning vertically upwards, away from the current line, searching for enclosing scopes. When I reach the top of the screen, I can't continue the mental search without scrolling of the buffer. This is when this context plugin comes in: it summarizes what's not visible on the screen but in relation to the currently highlighted line, not just the arbitrary line atop the screen.. That's exactly what the cursor-line-filtered mod accomplishes!

from context.vim.

Pawan-Bishnoi avatar Pawan-Bishnoi commented on May 22, 2024 3

vimContext

I mean I would imagine the preview screen to open up when the definition of a function/class (that I am currently looking at) moves out of screen

from context.vim.

wellle avatar wellle commented on May 22, 2024 3

@Pawan-Bishnoi: Thanks! I pushed a new branch which only adds lines to the context (still based on the cursor lines) which are not visible on screen:
https://github.com/wellle/context.vim/compare/10-cursor-line-filtered

I think there are still some issues where the context is not always automatically updated, but could you try that and let me know if that seems useful? Thanks!

from context.vim.

typhooncamel avatar typhooncamel commented on May 22, 2024 2

Thank you @wellle and everyone else - sorry, I've been away and couldn't check it out. I agree that 10-cursor-line is what I was after.

from context.vim.

idbrii avatar idbrii commented on May 22, 2024 2

10-cursor-line-filtered is just what I was looking for! I'm used to invoking context with a mapping (I have a command that :echos it -- but context does it better), so I don't want context on the screen unless it's currently relevant and I'd rather see more code at the top of the screen than context for a function I'm not currently editing.

Look forward to this being an option in master (to use it with popupwin)!

from context.vim.

wellle avatar wellle commented on May 22, 2024 2

@typhooncamel @Pawan-Bishnoi @jclifford-zd @idbrii @maxigit @wmusial @nilsboy @ThomasFeher @igorsol @mredaelli @GaurangTandon

Thanks for the interest and patience everyone. I've finished working on this over the last few days and just opened #76. I'd appreciate if some of you could try this new version and give me some feedback on it before I merge the PR. Thank you!

from context.vim.

wellle avatar wellle commented on May 22, 2024 1

Okay, thank you both for the feedback.

I'm currently working on something else (for #4) and will get back to this afterwards.

from context.vim.

wmusial avatar wmusial commented on May 22, 2024 1

works perfectly ๐Ÿ˜ . Thanks @wellle !!!

from context.vim.

wellle avatar wellle commented on May 22, 2024

Personally I don't feel like this would be useful, as in your case you already have the full context just on screen. But I'm willing to implement this as an option and have you try it if you really like it. Not high prio yet though.

from context.vim.

Pawan-Bishnoi avatar Pawan-Bishnoi commented on May 22, 2024

Thanks @wellle for the nice work you have done. I tried the 'follow the cursor' option but it turned out to be confusing and not as useful as I thought it would be.

I have a different suggestion:

Show the preview window only if a block of code overflows the screen

What do you think @typhooncamel

from context.vim.

wellle avatar wellle commented on May 22, 2024

@Pawan-Bishnoi: I'm not sure I understand. Can you clarify what you mean by a block of code?

from context.vim.

Pawan-Bishnoi avatar Pawan-Bishnoi commented on May 22, 2024

Thanks @wellle
That looks much better. I agree we might be missing a few corner cases here, I will keep an eye out for them.

from context.vim.

jclifford-zd avatar jclifford-zd commented on May 22, 2024

@wellle thanks for this. I have been using 10-cursor-line and it seems to work perfectly.

It suits my use case perfectly.

I prefer to see the full context of the cursor location (as opposed to the filtering on 10-cursor-line-filtered).

from context.vim.

maxigit avatar maxigit commented on May 22, 2024

This plugin is fantastic and is really handy for example to edit html file. This feature will really help to see which tags are the parent or too check if which if branch your are even when the screen is to small to trigger the context.

from context.vim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.