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

git.openFile keyboard shortcut does not work from a GitLens Compare view #395

Open
mliq opened this Issue Jun 4, 2018 · 13 comments

Comments

Projects
None yet
2 participants
@mliq

mliq commented Jun 4, 2018

  • GitLens Version: 8.3.3
  • VSCode Version: 1.23.1
  • OS Version: 10.13.5

Steps to Reproduce:

  1. "Compare File with Previous Revision"
  2. Attempt to execute "git.openFile" with a keyboard shortcut - nothing happens.
  3. Attempt to execute "git.openFile" via "Show All Commands" fuzzy search - nothing happens.
  4. Attempt to execute "git.openFile" via the button in tab bar located to the left of "Open Working File" - success.

Other Notes / Things I have tried:

  • I tried changing keyboard shortcut.
  • Note that my keyboard shortcut does appear correctly in the tooltip for the button and in the fuzzy search - yet the button works and keyboard shortcut and fuzzy search does not.

Workflow I am seeking:
Frequently, I want to copy text from a previous revision. The only way I have discovered to do this is with "Open File". If there is a better way, I would be happy to know it. Regardless, it is strange that keyboard shortcuts/fuzzy find does not work, only the UI button.

Thank you for your work and the amazing extension!

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 4, 2018

git.openFile isn't a command from GitLens, it is provided by the vscode git extension itself and since it doesn't know about GitLens files (uris) it doesn't work. I'm assuming you are trying to open the working version of that file? If so use the gitlens.openWorkingFile command instead.

Hope that helps.

@mliq

This comment has been minimized.

mliq commented Jun 5, 2018

@eamodio thank you for your response.

Perhaps I am going about it the wrong way, but my aim is this:

  1. to browse one-by-one back in file revision history using "Compare to Previous" keyboard shortcut - which sometimes seems to work and other times does not go back more than one revision.
  2. Then, when I reach a certain revision, I want to be able to copy and paste the red highlighted code and paste it in current code.

Do you have any suggestion for how to do this most efficiently?

Thank you!

@mliq

This comment has been minimized.

mliq commented Jun 5, 2018

I should note that Compare with Previous seems to always work using the button, but the keyboard shortcut only can go back one revision - why is this?

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 5, 2018

So there is a bug in the keybindings if you are using the chorded keymap, which I will fix in the next release. That will fix your first issue, as for the second, I'm not sure I understand the second issue. So you are going back in history, finding code you want, copying it, and then going back to the working file to paste it in? If so, there is no built in keyboard shortcut for the gitlens.openWorkingFile command, but you could add a shortcut to your keybindings.

Hope that helps!

@mliq

This comment has been minimized.

mliq commented Jun 6, 2018

@eamodio I think my issue is, in fact, primarily about keybindings, but it does not seem limited to chorded keymap. I have tried all keymaps, settling on user-defined, and several keyboard shortcuts do not work when going back in history.

For example: Previous Change and Next Change navigation.

  • I have keyboard shortcuts assigned to these, but they do not work in file history views.
  • The buttons do work.
  • the Keyboard shortcuts do work in the regular diff viewer triggered from Source Control view.

Thanks for your help!

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 7, 2018

@mliq I just release GitLens 8.3.4 which should hopefully fix the keyboarding issues. Please re-open this issue if not. Thanks!

@eamodio eamodio closed this Jun 7, 2018

@eamodio eamodio self-assigned this Jun 7, 2018

@eamodio eamodio added the bug label Jun 7, 2018

@eamodio eamodio added this to the Soon™ milestone Jun 7, 2018

@mliq

This comment has been minimized.

mliq commented Jun 8, 2018

Hi @eamodio - still not fixed. I don't think I am able to re-open the issue though, thank you.

@eamodio eamodio reopened this Jun 8, 2018

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 8, 2018

Can you provide more details as to what isn't working? Because I can't reproduce any issues with the shortcut keys with the latest release.

@mliq

This comment has been minimized.

mliq commented Jun 11, 2018

Here is an example:

  1. Define keyboard shortcut for workbench.action.compareEditor.nextChange.
  2. Execute "Compare File With Previous Revision" until multiple changes are present.
  3. Attempt to execute workbench.action.compareEditor.nextChange via keyboard shortcut - nothing happens.
  4. Attempt to execute workbench.action.compareEditor.nextChange via the UI button - it works.

UI Button in question:
ui button

@eamodio

This comment has been minimized.

Owner

eamodio commented Jun 11, 2018

Hrm, I cannot reproduce this. What version of vscode are you using? I've tried 1.24 and 1.25-insiders. I am on Windows though (and don't have access to a Mac currently).

@mliq

This comment has been minimized.

mliq commented Jun 14, 2018

I am on 1.24.1 and also had this on 1.23 and 1.24.0. Perhaps it is a Mac issue then...

@eamodio

This comment has been minimized.

Owner

eamodio commented Jul 15, 2018

@mliq Is this still an issue? If so, what are you using to setup the keybinding?

Here is mine -- and it works fine for me on Windows

    {
        "key": "alt+n",
        "command": "workbench.action.compareEditor.nextChange",
        "when": "editorTextFocus && isInDiffEditor"
    },

@eamodio eamodio modified the milestones: Soon™, Soonish™ Jul 15, 2018

@mliq

This comment has been minimized.

mliq commented Aug 25, 2018

@eamodio Yes, still an issue. I copied your keybinding setup above and no improvement.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment