Skip to content

Conversation

@Sneethe
Copy link

@Sneethe Sneethe commented Jul 7, 2025

Add feature per #53

@Sneethe
Copy link
Author

Sneethe commented Jul 7, 2025

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

@Sneethe
Copy link
Author

Sneethe commented Jul 7, 2025

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.

--select-1 \
--tac)

[[ $FZF_MARKS_JUMP_EXACT_MATCH == 1 ]] && args+=(--bind=one:accept --query='"^"')
Copy link
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.

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
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.

--query='"$*"' \
--select-1 \
--tac)
local args=(--ansi \
Copy link
Collaborator

@akinomyoga akinomyoga Jul 7, 2025

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 \


[[ $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
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