8000 Add separator when set before/after context · Issue #22 · Wilfred/deadgrep · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Add separator when set before/after context #22
Closed
@songsanli

Description

@songsanli

Hi Wilfred, thx for your work! Love the UI of *deadgrep* buffer.

I have a idea of enhancing and want to share it with you:

let's assume that we have a sample file "sample.js":

const A = () => {
  console.log("I'm function A");
};

const B = () => {
  console.log("I'm function B");
};

const C = () => {
  console.log("I'm function C");
};

I use deadgrep to search "console" and the result will be:

Search term: function change
Search type: string words regexp
Case: smart sensitive ignore
Context: none before after

Directory: ~/XXXX
Files: all type glob

sample.js
2    console.log("I'm function A");
6    console.log("I'm function B");
10   console.log("I'm function C");

Then I change both "before" and "after" context to 1, and I will get:

Search term: function change
Search type: string words regexp
Case: smart sensitive ignore
Context: none before:1 after:1

Directory: ~/XXXX
Files: all type glob

sample.js
1  const A = () => {
2    console.log("I'm function A");
3  };
5  const B = () => {
6    console.log("I'm function B");
7  };
9  const C = () => {
10   console.log("I'm function C");
11 };

It's hard to see the boundary of different result and I think a divider would help:

Search term: function change
Search type: string words regexp
Case: smart sensitive ignore
Context: none before:1 after:1

Directory: ~/XXXX
Files: all type glob

sample.js
1  const A = () => {
2    console.log("I'm function A");
3  };
...
5  const B = () => {
6    console.log("I'm function B");
7  };
...
9  const C = () => {
10   console.log("I'm function C");
11 };

To add a divider, I can see results with context in same file more clearly. What's your opinion?


M-x deadgrep-debug:

About your environment:
Platform: darwin
Emacs version: 26.1
Command: nil

Initial output from ripgrep:
nil

ripgrep version: 0.9.0.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0