Sublime Forum

Merge expects keydown to make commit hotkey work

#1

Hi,

When I staged files for the commit, then go to the commit message and hit Ctrl + V to paste commit message and then hit Ctrl + Enter it simply doesn’t work straight forward. The work-around is to type something to the commit message first, after which it works as expected.

It seems that you need to handle paste event as well to activate the hotkey on the commit field.

0 Likes

#2

Hey Ilia,

I’m unable to reproduce this bug, or maybe I misunderstood what the problem is, do you mind giving some more detail?
Is it just “Ctrl+Enter” not working? Or is “Ctrl+V” not working? Or both?
Is the workaround typing before or after you pasted the commit message?
Does clicking the commit field work as a workaround? Or do you have to type something?
What operating system you’re using? In case this is an issue specific to that operating system.

0 Likes

#3

Pasting text using Ctrl+V always worked. However, Ctrl+Enter (to submit the commit) doesn’t work reliable in a straight forward manner, unless you type in a commit field, or cut it first using Ctrl+X and then paste it over again.

Is the workaround typing before or after you pasted the commit message?

The work-around is to type after, one char, then delete or cut/paste right inside of the field it and then Ctrl+Enter works as expected.

Clicking actual buttons with mouse always worked as expected.

Does clicking the commit field work as a workaround?

No, neither clicking nor double clicking.

In case this is an issue specific to that operating system.

Unfortunately, I cannot say exactly right now. But the issue popped up for months before I actually decided to report it. I tried with both Fedora 35 Linux (Wayland GNOME 41.3) and mac OS Monterey and could only reproduce it on Fedora.

Try the following steps:

  1. Change the file
  2. Click stage button
  3. Switch between windows, like Sublime Text or Chrome browser, find and copy text to clipboard (I used keyboard for copy/paste)
  4. Go back to Sublime Merge and paste it
  5. Hit Ctrl+Enter and nothing would happen
  6. Use suggested above workarounds and it would work

I just discovered a new thing. If you take exactly the same steps as above but skip the step #3 (i.e. keep existing data in clipboard) then the issue doesn’t happen. It happens only when you copy/paste a new data and go directly to Sublime Merge to paste it.

Perhaps, it’s some security feature on GNOME that misbehaves?

0 Likes

#4

Hmm, still can’t reproduce it. If you don’t mind, can you try logging input and commands in sublime merge?

To do that:

  1. Go to “Preference->Edit Settings…
  2. Append “log_input: true” and “log_commands: true” to the preference file
  3. Press Ctrl+` in merge

You should now be able to see all your input and commands triggered in sublime merge. Hopefully that will narrow down the problem.

0 Likes

#5

I no longer have access to my desktop computer and this issue doesn’t happen on mac OS.

I assume that the issue was related to GNOME clipboard management. You would only be able to reproduce it on Fedora with GNOME.

0 Likes

#6

I see, that makes it quite tricky to find out what went wrong.

Thanks for reporting this issue regardless, we’ll keep an eye out for it.

1 Like