jreybert / vimagit

Ease your git workflow within Vim
1.31k stars 49 forks source link

Error using "S" on an expanded hunk #160

Closed unphased closed 6 years ago

unphased commented 6 years ago
Error detected while processing function <SNR>209_nmapping_wrapper[2]..magit#stage_hunk[32]..magit#stage_block:
line    9:
E33: No previous substitute regular expression
E33: No previous substitute regular expression

Have you seen this before?

I have many (MANY!) vim plugins. I do not have time right now, to bisect for conflicts, but just want to know if this is a known problem. Seems not to be.

I also have a question, can we think about making the formatting more colorized and clearer where the boundaries are between the unstaged changed hunks?

unphased commented 6 years ago

These errors don't seem to be actual bug-errors. I'm reading the built-in help now (thanks for making that!!!) and the features seem to work. So "S" is supposed to only for using on the top of the expanded hunks... I disagree with this, S should stage the hunk, you've already got a diff key for marking individual lines to stage ("M")!

unphased commented 6 years ago

I just encountered a situation where I couldn't use S to stage, with the error that I posted above. Even while on the first line of the hunk!

I think my point is that these errors really need to be prettified...

jreybert commented 6 years ago

I am not sure to understand all your points in this issue.

You can use the mapping S in the middle of a hunk to stage the complete hunk.

In the backtrace you provide, it seems you have a some line selected while you are pressing S. Is it intended? If you want to stage a complete hunk, you don't have to select lines. If you want to stage a part of a hunk, you can select some lines in one single hunk, without crossing the boundaries of the hunk.

Could you provide a screenshot just before pressing S and right after (with the error).

unphased commented 6 years ago

@jreybert what you describe is consistent with the documentation and instructions that I see for this plugin. I will get back to you. I seem not to be able to reproduce the errors that I saw yesterday now, so it appears to correspond also to behavior that I'm seeing.

This is a very useful plugin, thank you for making it.

jreybert commented 6 years ago

Hi @unphased ,

it seems that your problem is solved. Can I close the ticket?

unphased commented 6 years ago

Yep