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

E21: Cannot make changes, 'modifiable' is off #11

Open
sunaku opened this issue Apr 10, 2015 · 28 comments
Open

E21: Cannot make changes, 'modifiable' is off #11

sunaku opened this issue Apr 10, 2015 · 28 comments

Comments

@sunaku
Copy link

sunaku commented Apr 10, 2015

I have been getting this error after upgrading recently:

"~/.git/COMMIT_EDITMSG" 106L, 1744C
Error detected while processing function committia#open..<SNR>225_open_singlecolumn..<SNR>225_open_diff_window..<SNR>225_open_window:
line    8:
Error detected while processing function committia#open..<SNR>225_open_multicolumn..<SNR>225_remove_all_contents_except_for_commit_message:
line    4:
E21: Cannot make changes, 'modifiable' is off
Press ENTER or type command to continue

Thanks. 👼

@rhysd
Copy link
Owner

rhysd commented Apr 11, 2015

I can't reproduce. Could you tell me your configuration of committia.vim and show me the way to reproduce?

I guess you may already open commit buffer anywhere.

@sunaku
Copy link
Author

sunaku commented Apr 13, 2015

Sorry, you are correct. I deleted my ~/.vimrc file, checked out this repository to ~/.vim, and observed that the problem no longer occurs. 😱 Sorry for the confusion. 😕

@sunaku sunaku closed this as completed Apr 13, 2015
@sunaku
Copy link
Author

sunaku commented Apr 13, 2015

I found that the vim-diff-enhanced plugin was causing the problem! Removing it makes this plugin work correctly again. ✨

@rgrinberg
Copy link

Would be great to have a workaround for this as I really like the enhanced diff plugin.

@rhysd
Copy link
Owner

rhysd commented Apr 13, 2015

@sunaku

Thank you for your investigation. It seems that this plugin has a collision with vim-diff-enhanced. I'll investigate the reason.

@rhysd
Copy link
Owner

rhysd commented Apr 13, 2015

@sunaku @rgrinberg

I couldn't reproduce the error although I installed vim-diff-enhanced. But I added a change to set unmodified before setting filetype on the basis of @sunaku's error log. Could you update committia.vim and try it with vim-diff-enhanced?
If it doesn't still work, please let me know the way to reproduce the error.

@sunaku
Copy link
Author

sunaku commented Apr 14, 2015

@rhysd The problem occurs when source vim-diff-enhanced/plugin/EnhancedDiff.vim is executed before this plugin gets a chance to do its job. For example, this happens when I have vim-diff-enhanced installed as a "ftbundle" or filetype-specific bundle (whereby it is essentially autocmd FileType * source vim-diff-enhanced/plugin/EnhancedDiff.vim set up to run when the diff filetype is first loaded). 😅

@rafi
Copy link

rafi commented Feb 9, 2016

I'm receiving this error too, but I'm not using vim-diff-enhanced.

Error detected while processing function committia#open..<SNR>103_open_singlecolumn..<SNR>103_open_diff_w
indow..<SNR>103_open_window:
line    8:
E21: Cannot make changes, 'modifiable' is off

@rhysd
Copy link
Owner

rhysd commented Feb 9, 2016

I couldn't reproduce this. Could you please tell me the situation more?

  • What command? git commit? git commit --amend? git rebase?
  • OS

I will try to add workaround for this.

@rafi
Copy link

rafi commented Feb 9, 2016

  • Command: git commit, or git commit --amend
  • OSX 10.11.3
  • Git 2.7.1

@rhysd
Copy link
Owner

rhysd commented Feb 9, 2016

OK, thanks.

@rhysd
Copy link
Owner

rhysd commented Feb 9, 2016

BTW, you seems to use single-column mode. If you can, could you try double-column mode?

@rhysd
Copy link
Owner

rhysd commented Feb 9, 2016

I tried adding workaround. Please check it.

@rafi
Copy link

rafi commented Feb 9, 2016

The error doesn't appear, but I realized there's a problem with an extra buffer for each pane,
single-column:
image

double-column:
image

rhysd added a commit that referenced this issue Feb 9, 2016
@rhysd
Copy link
Owner

rhysd commented Feb 9, 2016

Thank you for the screenshots. Very helpful. I reverted the commit at the present.

Windows seem to be opened twice. Are you using :NeoBundleLazy to load commitia.vim?

@rhysd
Copy link
Owner

rhysd commented Feb 10, 2016

I added a workaround which prevents committia.vim from opening windows twice. Could you try this?

@rafi
Copy link

rafi commented Feb 10, 2016

@rhysd great, it works as expected!
However, the "edit window" isn't empty as shown in your double-column README screenshot. Looks good when it's empty...

@rhysd
Copy link
Owner

rhysd commented Feb 10, 2016

Hmm... all contents except for preset commit message should be removed here...

BTW, are you using :NeoBundleLazy to load committia.vim?

@rafi
Copy link

rafi commented Feb 10, 2016

Yes,

NeoBundleLazy 'rhysd/committia.vim', {'on_path': 'COMMIT_EDITMSG'}

@rhysd
Copy link
Owner

rhysd commented Feb 10, 2016

OK, I think it is the same reason as #18 and I may be able to reproduce this issue.

@rhysd
Copy link
Owner

rhysd commented Feb 10, 2016

Could you try below? I think the 'on_path': 'COMMIT_EDITMSG' configuration doesn't work.

NeoBundleLazy 'rhysd/committia.vim', {'explorer' : 1}

@rafi
Copy link

rafi commented Feb 10, 2016

It doesn't have a different effect. The "edit window" still includes the status and diff...

@rhysd
Copy link
Owner

rhysd commented Feb 10, 2016

I tried 'exporler': 1.

At fc80497, I confirmed "Cannot make changes, 'modifiable' is off" error.
And then after I updated to 4956c3e, it works well in my environment. Edit window is correctly cleared at git commit...

@rhysd
Copy link
Owner

rhysd commented Feb 10, 2016

Does it work with non-delayed loading?

NeoBundle 'rhysd/committia.vim'

@rafi
Copy link

rafi commented Feb 10, 2016

No, it still shows "edit window" full..

@rafi
Copy link

rafi commented Feb 10, 2016

When I look at :messages

Messages maintainer: Bram Moolenaar <Bram@vim.org>
"~/.config/.git/modules/vim/COMMIT_EDITMSG" 71L, 2224C
"~/.config/.git/modules/vim/COMMIT_EDITMSG" 71L, 2224C

It appears as if COMMIT_EDITMSG is loaded twice..

@rhysd
Copy link
Owner

rhysd commented Feb 11, 2016

In my environment, the message was shown only once...

2016-02-11 18 21 11

Hmm... It's hard to fix the bug without reproducing 🐶💦

@rafi
Copy link

rafi commented Feb 11, 2016

I will try to find a way to reproduce... thanks :)

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

4 participants