Hi Bram!
On Sa, 04 Mär 2017, Bram Moolenaar wrote:
>
> Christian Brabandt wrote:
>
> > Bram,
> > here are two small patches:
> >
> > 1) edit.patch: fixes a comment. This is so tiny, that it doesn't deserve
> > its own patch number.
>
> That's not right, the sentence starts with "Don't do this". It's indeed
> confusing. Perhaps this works better:
>
> /*
> * Handle restarting Insert mode.
> * Don't do this for "CTRL-O ." (repeat an insert): In that case we get
> * here with something in the stuff buffer.
> */
> if (restart_edit != 0 && stuff_empty())
That is clearer, thanks.
>
>
> > 2) getchar.patch: makes sure, that typebuf.tb_no_abbr_cnt is only set if
> > the ins_typebuf() function was called with the noremap argument being
> > non-zero. This actually fixes a problem I see with writing
> > test_edit.vim because otherwise using feekdeys('str') might not
> > expand abbreviations which was unexpected for me.
>
> OK, so that test is going to cover this change?
Only accidentally. Was trying the test to have an abbreviation expanded
and wondered why it did not work when using a
feedkeys("...\<c-l>", 'tnix') call. So I checked the source.
Interestingly, it worked when I moved the test to the beginning of the
file, which is where it currently resides, so it doesn't fail and I can
see how the coverage goes.
> Then perhaps we should
> make this change and add the test at the same time.
>
> Perhaps it's time to include that test now. It appears to be getting
> bigger and bigger.
I think I am about to be done now. Coverage for edit.c should be > 90 %
now and overall coverage seems to grow by about 0.7% which is quite
nice. I just want to watch the latest couple of patches (which might
increase the numbers slightly). When this is done, I am going to squash
it into a single patch and post back here.
Note, it also includes 2 changes for the C core, you might want to check
out:
https://github.com/vim/vim/pull/1521/commits/46905f956f2c67ec71f4c68ff89a8508a4d79ee5
and
https://github.com/vim/vim/pull/1521/commits/b46dc2664520453f1370148fd0c64f8b2ffddaa5
(the bug in strncmp is later fixed).
I needed a way to disable screen redrawing and I thought it would be
nicer to have a generic test_disable(name, val) function that could also
replace the test_disable_char_avail() function, so we wouldn't
accumulate to many test_disable_... functions just for testing purposes.
The advantage is, we can add more cases later if needed and I think we
can get rid of the test_disable_char_avail function as well and since
this function should only be needed for testing Vim itself, I think we
can silently delete this function.
Best,
Christian
--
Die Freiheit der Rede hat den Nachteil, daß immer wieder Dummes,
Häßliches und Bösartiges gesagt wird. Wenn wir aber alles in allem
nehmen, sind wir doch eher bereit, uns damit abzufinden, als sie
abzuschaffen.
-- Winston Spencer Churchill