Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistent jumps in jump action #23

Open
danymat opened this issue Feb 23, 2022 · 5 comments
Open

Inconsistent jumps in jump action #23

danymat opened this issue Feb 23, 2022 · 5 comments
Labels
enhancement New feature or request

Comments

@danymat
Copy link

danymat commented Feb 23, 2022

Hello, I found some issues with this option:

  • options mapping is not overridden by default: you need to add: u.merge(self.mapping, opts.mapping) in setup function.
  • Given this file:
function P(...)
	local objects = vim.tbl_map(vim.inspect, { ... })
	print(unpack(objects))
	return ...
end

RELOAD = function(...)
	return require("plenary.reload").reload_module(...)
end

R = function(name, opts)
	opts = opts or {}
	RELOAD(name)
	if opts.setup then
		return require(name).setup(opts.setup)
	end

	return require(name)
end

Prequire = function(module)
	local ok, mod = pcall(require, module)
	if ok then
		return mod
	end
end

Wrap = function(function_pointer, ...)
	local params = { ... }

	return function()
		return function_pointer(unpack(params))
	end
end

And this config:

		use({
			"ZhiyuanLck/smart-pairs",
			event = "InsertEnter",
			config = function()
				require("pairs"):setup({
					mapping = {
						jump_left_in_any = "<C-h>",
						jump_right_out_any = "<C-l>",
					},
				})
			end,
		})

jump left seems to always go to the first (of the file, and jump right seems to miss some right brackets.
Nevertheless, it's a very good plugin, and I kinda love it !

@ZhiyuanLck
Copy link
Owner

Thanks for your feedback! All options has been merged now.

There is a plan to rewrite the jump action after next refactor.

@ZhiyuanLck ZhiyuanLck added the enhancement New feature or request label Feb 23, 2022
@danymat
Copy link
Author

danymat commented Feb 23, 2022

Nice, thanks ! I keep forward to see the fix, good job !

@ZhiyuanLck ZhiyuanLck changed the title mapping options enhance jump actions Feb 23, 2022
@danymat danymat changed the title enhance jump actions Inconsistent jumps in jump action Feb 24, 2022
@danymat
Copy link
Author

danymat commented Mar 5, 2022

There is a plan to rewrite the jump action after next refactor.

Hello @ZhiyuanLck, what's the state of the refactor ?

@ZhiyuanLck
Copy link
Owner

Sorry, last week I have to work on the conference paper whose deadline is 3.7. The refactor work will continue after the paper deadline.

@danymat
Copy link
Author

danymat commented Mar 5, 2022

No problem, I was asking you because I wanted to work on this issue, but if you do refactor then it's not useful because it'll be re-written

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants