Skip to content

fix: fzf toc display and jump error when spaces in file path#1996

Merged
lervag merged 1 commit intolervag:masterfrom
WeixuanZ:master
Mar 21, 2021
Merged

fix: fzf toc display and jump error when spaces in file path#1996
lervag merged 1 commit intolervag:masterfrom
WeixuanZ:master

Conversation

@WeixuanZ
Copy link
Copy Markdown
Contributor

The file path and heading extracted by splitting at spaces would be wrong if the path contains spaces itself. Using \u2007 as a hack to preserve formatting (junegunn/fzf#585)

@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 21, 2021

The file path and heading extracted by splitting at spaces would be wrong if the path contains spaces itself. Using \u2007 as a hack to preserve formatting

Seems like a simple and useful hack. Thanks!

Do you have or can you show a simple test case for this?

@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 21, 2021

That is: Can you show a simple/minimal example that currently fails that this PR will fix?

@WeixuanZ
Copy link
Copy Markdown
Contributor Author

WeixuanZ commented Mar 21, 2021

Sure, this is when tests/test-toc/main.tex is renamed to test main.tex (i.e. including a space) and using the current code:

old

Selecting main.tex Preamble, would open tests/test-toc/test as a new file.

With this PR:

new

@lervag
Copy link
Copy Markdown
Owner

lervag commented Mar 21, 2021

Thanks!

@lervag lervag merged commit 61d5455 into lervag:master Mar 21, 2021
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