Skip to content

Add direct jump feature - #69

Open
Sneethe wants to merge 3 commits into
urbainvaes:masterfrom
Sneethe:direct-jump-feature
Open

Add direct jump feature#69
Sneethe wants to merge 3 commits into
urbainvaes:masterfrom
Sneethe:direct-jump-feature

Conversation

@Sneethe

@Sneethe Sneethe commented Jul 7, 2025

Copy link
Copy Markdown

Add feature per #53

@Sneethe

Sneethe commented Jul 7, 2025

Copy link
Copy Markdown
Author

Just realized I should probably add this to the bash and fish scripts. (I forget they existed)

@Sneethe

Sneethe commented Jul 7, 2025

Copy link
Copy Markdown
Author

And if you don't want the first field (your mark) to be whats matched.
For instance you want to match by path instead of mark you just backspace the ^ character.

Comment thread fzf-marks.plugin.bash
--select-1 \
--tac)

[[ $FZF_MARKS_JUMP_EXACT_MATCH == 1 ]] && args+=(--bind=one:accept --query='"^"')

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+= is bash >= 3.1. I think we should introduce a check for the Bash version.

Comment thread fzf-marks.plugin.bash
local delete_key=${FZF_MARKS_DELETE:-ctrl-d} paste_key=${FZF_MARKS_PASTE:-ctrl-v}
local lines=$(_fzm_color_marks < "${FZF_MARKS_FILE}" | eval ${FZF_MARKS_COMMAND} \
--ansi \
args=(--ansi \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

args should be localized.

Suggested change
args=(--ansi \
local -a args
args=(--ansi \

Note: There's also a bug with the form of local -a args=(...) in bash < 3.1.

Comment thread fzf-marks.plugin.zsh
--query='"$*"' \
--select-1 \
--tac)
local args=(--ansi \

@akinomyoga akinomyoga Jul 7, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

local args=(...) also doesn't work in bash < 3.1. It would be equivalent to local args="(...)" in bash < 3.1.

Suggested change
local args=(--ansi \
local -a args
args=(--ansi \

Comment thread fzf-marks.plugin.zsh

[[ $FZF_MARKS_JUMP_EXACT_MATCH == 1 ]] && args+=(--bind=one:accept --query='"^"')

local lines=$(_fzm_color_marks < "${FZF_MARKS_FILE}" | eval ${FZF_MARKS_COMMAND} ${args} )

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
local lines=$(_fzm_color_marks < "${FZF_MARKS_FILE}" | eval ${FZF_MARKS_COMMAND} ${args} )
local lines=$(_fzm_color_marks < "${FZF_MARKS_FILE}" | eval ${FZF_MARKS_COMMAND} ${args[@]} )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants