skywind3000 / skywind3000/z.lua

Let z -c match only the relative part of directory

Open
#76 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Lua
Stars
3.1k
Forks
148
PR merge metrics
No merged PRs in 30d

Description

Currently, z -c (and other options) match patterns against the whole directory to filter. However, this can be confusing (especially for z -c). As an example, assume z outputs:
2 /home/user/h
4 /home/user/a
Now at /home/user, z -c h goes to a, because '/home' contains 'h' and matches the pattern. This looks confusing for me, I suppose that z -c, as all its possible targets share the same prefix, should not match patterns against that prefix (pwd).

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the z -c option handling and trace how directory patterns are matched against the current working directory. Reproduce the example from the issue, then verify that matching ignores the shared pwd prefix and selects the relative directory part instead.

Written by the indexing model from the issue text.

Assessment

Tech stack
lua
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.