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

Added the ability to run a command after jumping e.g. 'zz' #1

Merged
merged 1 commit into from Aug 10, 2019

Conversation

@jamesl33
Copy link
Contributor

commented Aug 10, 2019

Added an additional variable to allow users to run a command after jumping, this mirrors the functionality available in the vim-slash plugin.

@codecov-io

This comment has been minimized.

Copy link

commented Aug 10, 2019

Codecov Report

Merging #1 into master will increase coverage by 0.52%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #1      +/-   ##
==========================================
+ Coverage   78.04%   78.57%   +0.52%     
==========================================
  Files          14       14              
  Lines          41       42       +1     
==========================================
+ Hits           32       33       +1     
  Misses          9        9
Impacted Files Coverage Δ
autoload/jumpy.vim 88% <100%> (+0.5%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 90fa9fc...27eb12e. Read the comment docs.

@arp242
Copy link
Owner

left a comment

Thanks :-) Just a few small comments

@@ -4,11 +4,13 @@ fun! jumpy#map(pattern) abort
return
endif

let l:after = get(g:, 'jumpy_after')

This comment has been minimized.

Copy link
@arp242

arp242 Aug 10, 2019

Owner

The default for get() is 0, not an empty string; I didn't test but I don't think this will work if it's undefined? I think this should do the expected:

let l:after = get(g:, 'jumpy_after', '')

Also note the rest of the file uses tab indentation, not spaces.

This comment has been minimized.

Copy link
@jamesl33

jamesl33 Aug 10, 2019

Author Contributor

I did test it leaving it undefined and it worked correctly, however, I have made the change anyway.

This comment has been minimized.

Copy link
@arp242

arp242 Aug 10, 2019

Owner

Thanks :-)

Yeah, it looks like it works, there's just an extra 0 at the end of the map:

:nmap [[
n  [[          *@:<C-U>call jumpy#jump(..)<CR>0

It'll go at the start of the line, so it's a mostly "invisible" side-effect :-)

This comment has been minimized.

Copy link
@jamesl33

jamesl33 Aug 10, 2019

Author Contributor

That's good to know, thanks for checking. I did also run a 'retab' but clearly forgot to set 'noexpandtab' but I see that you fixed it in the next commit, thanks :D

This comment has been minimized.

Copy link
@arp242

arp242 Aug 10, 2019

Owner

Yeah, indentation is annoying. I propose we just get rid of all of it.

Use `g:jumpy_after` to run a command after after jumping:

let g:jumpy_after = '' Default.
let g:jumpy_after = 'zz' Center the screen.

This comment has been minimized.

Copy link
@arp242

arp242 Aug 10, 2019

Owner

Can you align the second column with the above?

This comment has been minimized.

Copy link
@jamesl33

jamesl33 Aug 10, 2019

Author Contributor

Done.

@jamesl33 jamesl33 force-pushed the jamesl33:master branch from 865e359 to 27eb12e Aug 10, 2019

@arp242 arp242 merged commit 1bd06d2 into arp242:master Aug 10, 2019

3 checks passed

codecov/patch 100% of diff hit (target 78.04%)
Details
codecov/project 78.57% (+0.52%) compared to 90fa9fc
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.