- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 23.5k
 
Focus shader text editor when opened with quick open dialog #102193
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
base: master
Are you sure you want to change the base?
Conversation
| 
           I approve, this matches the behavior of the script editor.  | 
    
| 
           I wondered how I could make this changed merged. Shall I add it to the next call agenda ?  | 
    
| 
           @MartinDelille  | 
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and works as expected. Since this is a new feature, this will have to wait until 4.5.
Not sure if there are any style nitpicks applicable here.
| 
           Thank you for the feedback @paddy-exe !  | 
    
9f4cfb1    to
    2a04155      
    Compare
  
    There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR currently only works for shaders that are already open (even if not switched to). If the shader hasn't been opened yet it won't get focused. It also doesn't work with ShaderIncludes.
Hovever, doing it for shaders that are closed (ideally in _switch_to_editor), would probably cause issues since it would take focus from the ScriptEditor when the editor is loaded. I'm not sure if that is easily solvable, so it's fine if we want to keep the current approach for now.
2a04155    to
    a4220e9      
    Compare
  
    | 
           I moved the focus grab to   | 
    
          
 You need to squash the commits, if it's ready - see https://contributing.godotengine.org/en/latest/organization/pull_requests/creating_pull_requests.html#modifying-a-pull-request  | 
    
abb5708    to
    e761c71      
    Compare
  
    | 
           Done: e761c71  | 
    
| 
           Has I said there is a little side effect: when reponing a project with opened shader, the shader editor will be focused. I think this is can be acceptable. If not I would appreciate a hint to optionally do the focus at startup. I think I would need to add the   | 
    
This is my first PR to the project so don't hesitate to ask me for improvements or any kind of modification.
I was a little bit annoyed that opening a shader with the Quick open dialog didn't focus it in the editor, so I added a line to focus the editor when opening a shader.
I'm not sure all the case are handled so feel free to comment on that.