3 ms·
Very interesting exploit. Makes me feel good that I disable modelines because my company always sets columns=96, however I usually open multiple files with :vs
by jalgos_eminator 7y ago
Very interesting exploit. Makes me feel good that I disable modelines because my company always sets columns=96, however I usually open multiple files with :vsp and I have to manually change the columns to what my terminal actually is.
I would be interested to hear the historical reason for having such generic modeline execution in the first place. It seems a little out of place in text file editing.
- gbrown_ 7y ago> Makes me feel good that I disable modelines because my company always sets columns=96 Your company places this as a modeline in all its source files? If so why does your place of work enforce modelines in its source?
- jalgos_eminator 7y agoThey don't "enforce" it, but all the code written by the two largest contributors always has it. Its a startup, so those two contributors wrote the majority of the codebase.
- dmix 7y agoYou mean they include editor configuration in all of their source code files? Not just some special cases?
- jalgos_eminator 7y ago# vim:set columns=96 expandtab nocindent nosmartindent ff=unix: This is in basically every source code file just below the shebang.
- dmix 7y agoI've never seen anyone do this. There are so many better solutions to this problem and it's a heavy-handed/messy solution that is difficult to change/maintain. I'd push back on this hard if I was told to do it.
- jalgos_eminator 7y agoI'm not told to do it, but I don't write hardly any of the code in the repo. So when I have to go inspect one of their source files, which I do many times per day, then it gets me. Usually if I'm on some VM that doesn't have my own .vimrc in it. It is what it is, just a minor annoyance and a few key strokes to fix (":set columns=xxx", then "C-w =").
- dguaraglia 7y agoThe editorconfig plugin might be your friend. I've made it a requirement for every project in our company to have an .editorconfig file.