Skip to content

Action to copy path and filename of result? #1703

Closed Answered by ibhagwan
benfrain asked this question in Q&A
Discussion options

You must be logged in to vote

I have tried adding print("hello") into the get_line_and_path function but nothing is displayed in the command line area too. Sorry, I'm very inexperienced with Lua as you may have guessed!

Now is the time to get your hands dirty troubleshooting :)

If it prints “function 0x” you gave it a function object to print, try print(1, object) so you can track the code route and you’ll figure it out, see which route is taken and which register is saved, if you want only the clipboard you only need this line vim.fn.setreg([[+]], file_and_path) but it needs to be changed to vim.fn.setreg([[+]], file_and_path.path) (as entry is a table).

To dump table objects use vim.print(file_and_path).

Replies: 3 comments 10 replies

Comment options

You must be logged in to vote
3 replies
@ibhagwan
Comment options

@enoryw
Comment options

@ibhagwan
Comment options

Comment options

You must be logged in to vote
3 replies
@ibhagwan
Comment options

@benfrain
Comment options

@ibhagwan
Comment options

Answer selected by benfrain
Comment options

You must be logged in to vote
4 replies
@ibhagwan
Comment options

@benfrain
Comment options

@ibhagwan
Comment options

@benfrain
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants