Skip to content
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

Always source file after funced #10318

Merged
merged 1 commit into from Feb 22, 2024
Merged

Conversation

mqudsi
Copy link
Contributor

@mqudsi mqudsi commented Feb 21, 2024

... even if the file hasn't changed. This addresses an oddity in the following case:

  • Shell is started,
  • function foo is sourced from foo.fish
  • foo.fish is externally edited and saved
  • <Loaded definition of foo is now stale, but fish is unaware>
  • funced foo loads type -p foo showing changed definition, user exits $EDITOR saving no changes (or with $status 0, more generally).
  • Stale definition of foo remains

... even if the file hasn't changed. This addresses an oddity in the following
case:

* Shell is started,
* function `foo` is sourced from foo.fish
* foo.fish is *externally* edited and saved
* <Loaded definition of `foo` is now stale, but fish is unaware>
* `funced foo` loads `type -p foo` showing changed definition, user exits
  $EDITOR saving no changes (or with $status 0, more generally).
* Stale definition of `foo` remains
@mqudsi mqudsi merged commit 2c2ab0c into fish-shell:master Feb 22, 2024
7 checks passed
@mqudsi mqudsi deleted the funced_source branch February 22, 2024 18:45
@zanchey zanchey added this to the fish 3.7.1 milestone Feb 23, 2024
faho pushed a commit that referenced this pull request Mar 13, 2024
... even if the file hasn't changed. This addresses an oddity in the following
case:

* Shell is started,
* function `foo` is sourced from foo.fish
* foo.fish is *externally* edited and saved
* <Loaded definition of `foo` is now stale, but fish is unaware>
* `funced foo` loads `type -p foo` showing changed definition, user exits
  $EDITOR saving no changes (or with $status 0, more generally).
* Stale definition of `foo` remains

(cherry picked from commit 2c2ab0c)
krobelus added a commit that referenced this pull request Apr 12, 2024
Regressed in 2c2ab0c (Always `source` file after `funced` (#10318),
2024-02-22) which was only intended for functions that are backed by a file.
vertesians pushed a commit to vertesians/fish-shell that referenced this pull request Apr 17, 2024
Regressed in 2c2ab0c (Always `source` file after `funced` (fish-shell#10318),
2024-02-22) which was only intended for functions that are backed by a file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants