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

Incompatible with :saveas #37

Open
laci37 opened this issue Mar 21, 2024 · 0 comments
Open

Incompatible with :saveas #37

laci37 opened this issue Mar 21, 2024 · 0 comments

Comments

@laci37
Copy link

laci37 commented Mar 21, 2024

Describe the bug

When trying to make a new copy of the notebook I'm working on with :saveas, the buffer name changes, the message "two.ipynb saved via jupytext" appears, but no new file is created, while the previous one is overwritten. Steps to reproduce:

  1. :ed one.ipynb
  2. Make edits, :w
  3. More edits
  4. :saveas two.ipynb

Diagnostics

  • vim --version:
centi@centi-Latitude-3540:~$ nvim --version
NVIM v0.10.0-dev
Build type: RelWithDebInfo
LuaJIT 2.1.0-beta3
Run "nvim -V1 -v" for more info
  • Operating system information (e.g. uname -a):
centi@centi-Latitude-3540:~$ uname -a
Linux centi-Latitude-3540 6.5.0-18-generic #18~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Feb  7 11:40:03 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
  • python --VV:
centi@centi-Latitude-3540:~$ python -VV
Python 3.10.12 (main, Nov 20 2023, 15:14:05) [GCC 11.4.0]
  • Are you using Anaconda? No
  • Put let g:jupytext_print_debug_msgs = 1 in your ~/.vimrc. What is the output of :messages when reproducing the problem?
// :ed one.ipynb
DBG: filename: /home/centi/one.ipynb
DBG: filename exists: 0
DBG: jupytext_file: /home/centi/one.py
DBG: jupytext_file exists: 0
DBG: autocmd jupytext_ipynb BufUnload <buffer> call s:cleanup("/home/centi/one.py", 1)
DBG: autocmd jupytext_ipynb BufWriteCmd,FileWriteCmd <buffer> call s:write_to_ipynb()
DBG: filetype: python
// :w
DBG: overwriting /home/centi/one.py
DBG: Updating notebook from /home/centi/one.py
DBG: cmd: jupytext --from=py --to=ipynb --update '/home/centi/one.py'
DBG: [jupytext] Reading /home/centi/one.py in format py^@[jupytext] Writing /home/centi/one.ipynb
// :saveas two.ipynb
DBG: overwriting /home/centi/one.py
DBG: Updating notebook from /home/centi/one.py
DBG: cmd: jupytext --from=py --to=ipynb --update '/home/centi/one.py'
DBG: [jupytext] Reading /home/centi/one.py in format py^@[jupytext] Writing /home/centi/one.ipynb (destination file updated)
  • Does converting the notebook to/from ipynb with jupytext on the command line work? Not tested, conversion works correctly in vim.

  • Does it work when you set g:jupytext_command in ~/.vimrc to be the exact some jupytext that you used manually, with the exact same version of Python? Not tested, conversion works correctly in vim.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant