Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Fmt.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,7 @@ def extract_variables(view):
vars = view.window().extract_variables()
vars['tab_size'] = str(tab_size)
vars['indent'] = indent
vars['scope'] = view_scope(view)
vars.update(os.environ)
Copy link
Contributor Author

@lethosor lethosor May 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is a possible improvement here where os.environ could be given lowest priority. Right now it is given highest priority, so e.g. if someone happens to have an environment variable named file, $file in formatter commands would expand to that, rather than the value returned from view.window().extract_variables() here. I'm not sure when this behavior would be desirable.


return vars
Expand Down