GithubHelp home page GithubHelp logo

Comments (10)

mcornella avatar mcornella commented on June 2, 2024

Oops that's my bad, thanks for the submission! I'll take a look shortly.

from ohmyzsh.

mcornella avatar mcornella commented on June 2, 2024

Can you test in your macOS whether #12401 fixes this correctly? I'm not too sure about AWK regex support in there. You can test it out with omz pr test 12401.

from ohmyzsh.

alexrosenfeld10 avatar alexrosenfeld10 commented on June 2, 2024

@mcornella thanks for the quick reply. Here's the result of the test:

take one, all in one line

~/.zshrc file plugins section before:

plugins=(git autoupdate git-open zsh-syntax-highlighting zsh-autosuggestions autojump brew docker fzf rust thefuck zsh-interactive-cd zsh-bat asdf)

result:

❯ omz pr test 12401
❯ code ~/.zshrc
❯ omz plugin disable git
/Users/alexrosenfeld/.zshrc:81: parse error near `)'
omz::plugin::disable: broken syntax in '~/.zshrc'. Rolling back changes...

~/.zshrc file plugins section after, unchanged.

take two, with newlines instead

~/.zshrc file plugins section before:

plugins=(
  git
  autoupdate
  git-open
  zsh-syntax-highlighting
  zsh-autosuggestions
  autojump
  brew
  docker
  fzf
  rust
  thefuck
  zsh-interactive-cd
  zsh-bat
  asdf
)

command result:

❯ omz pr test 12401
❯ code ~/.zshrc
❯ omz plugin disable git
omz::plugin::disable: plugins disabled: git.

~/.zshrc file plugins section after, result looks good:

plugins=(
  autoupdate
  git-open
  zsh-syntax-highlighting
  zsh-autosuggestions
  autojump
  brew
  docker
  fzf
  rust
  thefuck
  zsh-interactive-cd
  zsh-bat
  asdf
)

take three, bonus round, new error case discovered

starting state, same as take two (plugins separated by newlines):

plugins=(
  git
  autoupdate
  git-open
  zsh-syntax-highlighting
  zsh-autosuggestions
  autojump
  brew
  docker
  fzf
  rust
  thefuck
  zsh-interactive-cd
  zsh-bat
  asdf
)

shell commands:

❯ omz plugin disable git
omz::plugin::disable: plugins disabled: git.
❯ omz plugin enable git
omz::plugin::enable: plugins enabled: git.
❯ omz plugin disable git
/Users/alexrosenfeld/.zshrc:127: parse error near `\n'
omz::plugin::disable: broken syntax in '~/.zshrc'. Rolling back changes...

state after the first disable + first enable:

plugins=(
  autoupdate
  git-open
  zsh-syntax-highlighting
  zsh-autosuggestions
  autojump
  brew
  docker
  fzf
  rust
  thefuck
  zsh-interactive-cd
  zsh-bat
  asdf
 git)

from ohmyzsh.

mcornella avatar mcornella commented on June 2, 2024

Fixed that now as well, can you try again?

from ohmyzsh.

alexrosenfeld10 avatar alexrosenfeld10 commented on June 2, 2024

@mcornella still seems there are some issues:

results:

plugin array without newlines

❯ omz pr test 12401
omz::pr::test: fetching PR #12401 to ohmyzsh/pull-12401...
remote: Enumerating objects: 13, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 4 (delta 3), reused 2 (delta 1), pack-reused 0
Unpacking objects: 100% (4/4), 850 bytes | 212.00 KiB/s, done.
From https://github.com/ohmyzsh/ohmyzsh
 + 141a154...2d7a73e refs/pull/12401/head -> ohmyzsh/pull-12401  (forced update)
omz::pr::test: rebasing PR #12401...
Successfully rebased and updated refs/heads/ohmyzsh/pull-12401.
omz::pr::test: fetch of PR #12401 successful.
omz::pr::test: running `zsh` to test the changes. Run `exit` to go back.
❯ omz plugin disable git
/Users/alexrosenfeld/.zshrc:81: parse error near `)'
omz::plugin::disable: broken syntax in '~/.zshrc'. Rolling back changes...

plugin array with newlines

❯ omz plugin disable git
omz::plugin::disable: plugins disabled: git.
❯ omz plugin enable git
omz::plugin::enable: plugins enabled: git.
❯ omz plugin disable git
/Users/alexrosenfeld/.zshrc:129: parse error near `\n'
omz::plugin::disable: broken syntax in '~/.zshrc'. Rolling back changes...

Maybe there's a way for you to test your changes without back and fourth? I don't mind helping at all, but at the same time, it doesn't seem the most efficient

from ohmyzsh.

mcornella avatar mcornella commented on June 2, 2024

OK that should be all the edge cases fixed now. I introduced a test suite which will be refactored into its own thing in the future. Sorry for the back and forth, I was in a rush this morning to get this out.

The tests already done here are working correctly.

from ohmyzsh.

alexrosenfeld10 avatar alexrosenfeld10 commented on June 2, 2024

@mcornella thanks for fixing. I think there are still some issues here though:

~/.zshrc:

plugins=(
  git
  git-open
  autoupdate
  zsh-syntax-highlighting
  zsh-autosuggestions
  autojump
  brew
  docker
  fzf
  rust
  thefuck
  zsh-interactive-cd
  zsh-bat
  asdf
)

result:

❯ omz plugin disable git
omz::plugin::disable: plugin 'git' is not enabled.

from ohmyzsh.

alexrosenfeld10 avatar alexrosenfeld10 commented on June 2, 2024

same behavior for

plugins=(git git-open autoupdate zsh-syntax-highlighting zsh-autosuggestions autojump brew docker fzf rust thefuck zsh-interactive-cd zsh-bat asdf)

from ohmyzsh.

mcornella avatar mcornella commented on June 2, 2024

The function only disables a plugin if it's in the $plugins array within the session. That's by design. If you make changes to it, you should omz reload beforehand.

from ohmyzsh.

alexrosenfeld10 avatar alexrosenfeld10 commented on June 2, 2024

ah, got it, ok. thanks!!

from ohmyzsh.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.