4 ms·
> Does ":w" have different behaviour to ":wq"? Or does ":w" have a different behaviour than ":up"(save file if changed) in this context? My guess would be that
by alpaca128 7y ago
> Does ":w" have different behaviour to ":wq"?
Or does ":w" have a different behaviour than ":up"(save file if changed) in this context?
My guess would be that both just reuse the same functionality(why be inconsistent for no reason?).
But regardless it's good to know this edge case can occur - trying to find the cause otherwise and reproducing the problem would be a nightmare, even if the behaviour was consistent across editors.
EDIT: I tested using 'ls -li' to look at the file's inode, and while ":w", ":wq" as well as ":up" always result in a new file it seems that multiple changes can cause the inode to go back to a previously used number. So maybe this issue can occur with every editor if the file is saved multiple times.
- hiasen 7y ago> it seems that multiple changes can cause the inode to go >back to a previously used number. So maybe this issue can >occur with every editor if the file is saved multiple times. I doubt that a inode reuse can make this happen, since the inode will not be reused while bash keeps the file open.