Nothing Special   »   [go: up one dir, main page]

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

Ensure lazyredraw is enabled (2) #49

Merged
merged 5 commits into from
Sep 12, 2019
Merged

Ensure lazyredraw is enabled (2) #49

merged 5 commits into from
Sep 12, 2019

Conversation

mg979
Copy link
Contributor
@mg979 mg979 commented Sep 11, 2019

Prelude

Thank you for helping out DoGe!

By contributing to DoGe you agree to the following statements (Replace [ ] with [x] with those you agree with):

Why this PR?

Similar to #46, but it is controlled by a global variable, that can be set to 0 to disable the check. I don't think it's important to document it because it can only be beneficial, at the same time the test vimrc must be able to disable it.

I'd prefer this approach to the discussed hlsearch one (that can also work), because if hlsearch isn't restored it can be annoying.

This can happen because right now mappings deactivation is not automatic, it waits for a Tab that can't find anything (as it was before, when there weren't buffer mappings).

lazyredraw is harmless in comparison and it's pointless not to use it because Vader apparently doesn't support it.

The second commit simply restores the old search register after deactivation.

Enable lazyredraw in doge#activate(), if disabled.
Disable in doge#deactivate(), if it has been enabled by DoGe.
Disable in test/vimrc because of failing tests.
@kkoomen
Copy link
Owner
kkoomen commented Sep 12, 2019

Besides the two comments: happy you came with another solution and I think it's a good option for now.

@kkoomen
Copy link
Owner
kkoomen commented Sep 12, 2019

Do you perhaps know why :echo @/ returns something different than :echo histget('search')? because :echo histget('search') is actually returning the placeholder regex after DoGe is deactivated.

@mg979
Copy link
Contributor Author
mg979 commented Sep 12, 2019

Because history is changed when you enter something in the command line ('/'), and you do that in the jump functions (like here), if you set the search register with let @/ it's not recorded in the history (keeppatterns doesn't seem necessary in this case).

@mg979
Copy link
Contributor Author
mg979 commented Sep 12, 2019

It would be maybe better to set the TODO patter directly with let @/, but then it would probably need some changes in how you select the patterns.

@kkoomen
Copy link
Owner
kkoomen commented Sep 12, 2019

Fair enough. Seems good to me. Anything you like to add? Otherwise I'll merge. I tested it and it works as expected to me. What about you?

@mg979
Copy link
Contributor Author
mg979 commented Sep 12, 2019

I think it's working well, I don't see flashes anymore :).

@kkoomen kkoomen merged commit a3ff317 into kkoomen:master Sep 12, 2019
@kkoomen
Copy link
Owner
kkoomen commented Sep 12, 2019

This bug has been fixed and released in v1.13.1.

Feel free to submit any new issues if you experience any unwanted behavior in the future. Thanks for your contribution.

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