Given a buffer number
i, I want to check if the buffer has been modified after the last save. How do I do that in vimscript?
I tried to use
getbufvar() like the following:
if getbufvar(i, "&modified") echo "Modified" else echo "Not Modified" endif
but this always seems to
echo "Modified". What am I doing wrong?