Skip to content

Question on how "relative_to" option works #178

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

You must be logged in to vote

Well yes turns out my function is just wrong, refactored it like this:

local function get_relative_path()
	local workspace = vim.lsp.buf.list_workspace_folders()[1]
	if workspace and workspace ~= "" then
		return workspace
	end

	local buffer_path = vim.fn.getcwd()
	return buffer_path
end

Would happy to know if there's better way to do this though

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by maxguuse
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant