-
Notifications
You must be signed in to change notification settings - Fork 41
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
CommandInputHandler.initial_selection
not being called for plugin
#5972
Comments
Working fine here. (Also on ST4143 on Windows) Note that InputHandler work only if a command is registered in a Default.sublime-commands file. |
Hi @deathaxe, I tried your suggestion, changed the name of my commands file to Default, but it is still not being called. |
A Default.sublime-commands located in your package folder is all you need. I just created a Packages/DebugInputHandler folder, and created those two files with content pasted from your initial post. Command is called, and Note: python modules (plugins) are loaded from package's root folder. |
I can confirm it does not work for me after making a new folder and following the same steps |
@deathaxe Do you have any idea why it might not be working on my system? |
You could try to add your example code to a ST instance running in SAFE MODE, to check whether other plugins etc. might be involved. But otherwise I don't have any idea, as it is working fine on my box. Same OS, same ST build. Have also couple other plugins using that functionality. |
Hey @deathaxe, sorry to bother you again, but just in case I did something wrong thrice, could you send your dummy package as a zip? |
I have nothing more to add here. |
Following the steps given results in the plugin working as expected on my end too. Made a |
I just opened #6175 with a description of the cause and with an easy fix in @BenjaminSchaaf I can confirm this on ST4152, or maybe was it fixed in the meanwhile? For more context see my linked issue. |
Ah yes, the difference is likely the plugin environment. As part of the fix for #6175 I've added that functionality for the 3.3 environment, so I'll leave this closed in favor of that issue. |
Thank you @jwortmann for looking into that! I thought I was going insane |
Description of the bug
I have made a very simple "Duplicate File" plugin, which makes use of the
CommandInputHandler
and I want the text input to have the same functionality as the Rename File default plugin (Default/rename.py
). I had copied over the code for the Input Handler, which does implementinitial_selection
as such:(I added the print statement for debugging)
This does work in the default rename plugin as only the file name is selected initially and not the extension, but it does not work in my plugin, and on further inspection, the function is not even called, as there was no print in the console.
I have looked around and cannot seem to find any differences in the Input Handler.
This seems like a bug, but I apologize if I am mistaken.
Steps to reproduce
Here is a dummy plugin that does nothing except for calling the input handler.
To call this, here is a simple
.sublime-commands
file:Expected behavior
I expect the
initial_selection
function to be called as it does in the default plugin.Actual behavior
The
initial_selection
function is not called.Sublime Text build number
4143
Operating system & version
Windows 10
(Linux) Desktop environment and/or window manager
No response
Additional information
No response
OpenGL context information
No response
The text was updated successfully, but these errors were encountered: