Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to expand to more lines in multi-buffer view #5377

Closed
fdionisi opened this issue Jun 9, 2022 · 6 comments
Closed

Ability to expand to more lines in multi-buffer view #5377

fdionisi opened this issue Jun 9, 2022 · 6 comments
Labels
design [core label] discoverability Feedback for discoverability of features, settings, etc editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] multi-buffer priority request A request from a stakeholder or influential user

Comments

@fdionisi
Copy link
Contributor

fdionisi commented Jun 9, 2022

Is your feature request related to a problem? Please describe.
Project search and multi-buffer editing is a killer feature. Kudos!
But at times when searching for a term in a big/unknown repo, you may want to have more context around the result.

Describe the solution you'd like
Similarly as the GitHub PR provides (fig. below), would be cool if the multi-buffer view could allow users to expand lines above and/or below a result.

Describe alternatives you've considered
Perhaps having the ability to open the file in a normal buffer view, but would defeat the amazing multi-buffer experience.

Screenshot 2022-06-09 at 15 09 33

@fdionisi fdionisi added the enhancement [core label] label Jun 9, 2022
@nathansobo nathansobo transferred this issue from another repository Jun 9, 2022
@JosephTLyons JosephTLyons changed the title Ability to expand to more lines in mutli-buffer view Ability to expand to more lines in multi-buffer view Jun 10, 2022
@JosephTLyons
Copy link
Contributor

JosephTLyons commented Jun 17, 2022

This is something I've been interested in for awhile. Some ideas I that came to mind were:

  • A setting could be added to specify the default number of context lines
  • A global button could be placed somewhere up near the global search input widget that could adjust the amount of context for all excerpts (this may not be a good idea though, as that might be rather expensive)
  • Individual adjustment buttons to tweak each one differently, as needed

@mikayla-maki
Copy link
Contributor

I could definitely see an expand button next to the ‘jump to’ button. Would help lower the cycle time on exploring APIs usages in large codebases.

@JosephTLyons JosephTLyons added the editor Feedback for code editing, formatting, editor iterations, etc label Jul 21, 2022
@mikayla-maki mikayla-maki added the design [core label] label Aug 5, 2022
@jansol
Copy link
Contributor

jansol commented Mar 15, 2023

Just my 2c: sometimes you need a couple more lines of context because of formatting in some places but not in others. Being able to expand views individually on demand would be nice in such situations.

@mikejohnstn
Copy link

mikejohnstn commented Jun 16, 2023

My 2c as well: reducing context is as important to me as expanding.

When I tried to switch to Zed, I quickly realized how much I rely on very dense global search results with only one line of context per result, something like this:
image

I love Zed's multi-buffer but the file headers use too much vertical space and the default context size for search makes it impossible to see lots of results on one screen (unless I'm missing an option somewhere which is entirely possible).

@JosephTLyons JosephTLyons transferred this issue from zed-industries/community Jan 24, 2024
@JosephTLyons JosephTLyons added the priority request A request from a stakeholder or influential user label Mar 4, 2024
@maxdeviant
Copy link
Member

Feedback from @erikareads in the Gleam Discord:

is there a way to expand the number of lines shown in the search view?
That is, before and after the search result?
A co-worker uses Zed, and the context we needed was just below the fold on each of the search results because of how the call-sites were prettified.
Context I could/would add: ripgrep separates this into two flags:
--after-context which does lines after the matched line
and --before-context which does lines before the matched line.
--context is a shorthand for doing both.

@JosephTLyons
Copy link
Contributor

This PR adds in the UI and a keybinding to expand the multi-buffer excerpts:

You can customize the number of lines that get expanded (see the PR). I think we can close this issue out. This does not add in the ability to shrink the excerts, but if the demand for that is high enough for that, we can add that in in a a follow-up.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
design [core label] discoverability Feedback for discoverability of features, settings, etc editor Feedback for code editing, formatting, editor iterations, etc enhancement [core label] multi-buffer priority request A request from a stakeholder or influential user
Projects
None yet
Development

No branches or pull requests

7 participants