wincent / vcs-jump

🤾🏻‍♀️ Jump to interesting places with a Git or Mercurial repo
BSD 2-Clause "Simplified" License
29 stars 2 forks source link

`vcs-jump diff ...` doesn't work #8

Closed RRethy closed 3 years ago

RRethy commented 3 years ago

When running vcs-jump diff ... in a terminal or VcsJump diff ... in Vim, nothing is picked up even if there are changes in the repo. From looking at the code I think it's because of these lines which short-circuit the boolean expression whether the regex matches or not. ~This is because a regex match evals to 0 which is truthy except for things like &&~. I'll verify this tmrw and I can put up a PR to fix if it's the case.

RRethy commented 3 years ago

For reference if I run 'hello' =~ /hello/ in irb I get a result of 0 with version irb 1.2.3 (2020-02-15) and ruby 2.7.1p83 (2020-03-31 revision a0c7c23c9c) [x86_64-darwin18].

RRethy commented 3 years ago

Nvm it seems 0 is truthy even in the boolean expression, my Ruby is a bit rusty. Seems to be something else.

RRethy commented 3 years ago

It seems the regex was incorrectly failing to match file lines. PR has been created with fix.

RRethy commented 3 years ago

Fixed in #9