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

:finish can no longer be used in exrc files since v0.9.0 #28481

Open
Frederick888 opened this issue Apr 24, 2024 · 0 comments · May be fixed by #28486
Open

:finish can no longer be used in exrc files since v0.9.0 #28481

Frederick888 opened this issue Apr 24, 2024 · 0 comments · May be fixed by #28486
Assignees
Labels
bug issues reporting wrong behavior has:vim-patch issue is fixed in vim and patch needs to be ported startup Nvim startup sequence (`:h startup`) vimscript
Milestone

Comments

@Frederick888
Copy link
Sponsor Contributor

Problem

Since v0.9.0, I started getting

Error detected while processing .exrc:
E168: :finish used outside of a sourced file

...due to finishes in my .exrc.

I suspect this is related to the vim.secure.read() + exrc changes.

Steps to reproduce

  1. Enable exrc
  2. Create a .exrc file like (This is how/why I use finish in exrcs. To reproduce the issue itself, a simple finish anywhere should do.)
    if index(['git', 'gh'], trim(split(system('ps -o comm= ' .. luaeval('vim.loop.os_getppid()')), '/')[-1])) >= 0
          \ || stridx(trim(split(system('ps -o command= ' .. luaeval('vim.loop.os_getpid()')), '/')[-1]), '+Man!') >= 0
      finish
    endif
    
    " lots of settings
  3. Start Neovim (In my case, use Neovim as Git editor and git commit, or use Neovim as Manual pager then man ...)

Expected behavior

:finish still works in exrcs.

Neovim version (nvim -v)

v0.9.5

Vim (not Nvim) behaves the same?

No, 9.1 (2024 Jan 02, compiled Apr 18 2024 20:05:12)

Operating system/version

macOS 14.4.1

Terminal name/version

Kitty 0.34.1

$TERM environment variable

tmux-256color

Installation

Homebrew

@Frederick888 Frederick888 added the bug issues reporting wrong behavior label Apr 24, 2024
@zeertzjq zeertzjq added startup Nvim startup sequence (`:h startup`) has:vim-patch issue is fixed in vim and patch needs to be ported labels Apr 24, 2024
@zeertzjq zeertzjq self-assigned this Apr 24, 2024
@zeertzjq zeertzjq linked a pull request Apr 24, 2024 that will close this issue
@zeertzjq zeertzjq added this to the 0.11 milestone Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug issues reporting wrong behavior has:vim-patch issue is fixed in vim and patch needs to be ported startup Nvim startup sequence (`:h startup`) vimscript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants