Olical / vim-enmasse

Edit every line in a quickfix list at the same time
The Unlicense
208 stars 5 forks source link

only use valid quickfix entries #27

Closed artm closed 8 years ago

artm commented 8 years ago

otherwise enmasse buffer will contain an empty line and complain on write.

this happens to me when running enmasse on Ag quickfix buffer

Olical commented 8 years ago

I'll have to give this a go locally. Is it definitely working for you? Odd that the tests are failing, they were always a bit brittle.

Olical commented 8 years ago

a hint is displayed for the first line on open

Is the failing test I think?

artm commented 8 years ago

it solves my problem, but I haven't ran the tests locally, as I'm unfamiliar with vader. to reproduce the problem try it with Ag plugin, which produces empty invalid lines between search entries.

Olical commented 8 years ago

Huh, that's weird! Mine doesn't have extra lines, which Ag plugin are you using?

asciicast

artm commented 8 years ago

a hint is displayed for the first line on open

Is the failing test I think?

looks like it

artm commented 8 years ago

I'm using this one, but could be something else messes it up. I'm not sure why I'm not using the original plugin though

artm commented 8 years ago

huh, it doesn't produce empty lines now that I'm testing it. definitely looks like a conflict triggered by something else in my work environment then.

Olical commented 8 years ago

Are you using Windows by any chance? Could be the whole \r\n != \n thing?

artm commented 8 years ago

I'm on linux myself, but could have some windows files in our codebase. I tried Ag in there and I'm getting the empties again. will have a look at offending files

artm commented 8 years ago

the file that makes it produce empty lines has fileformat=unix, but I see now that not every file does that:\

image

artm commented 8 years ago

looks pretty much random, i'm confused

Olical commented 8 years ago

Compare those two files? Maybe use file on them? There's probably ways to check linendings, maybe even run DOS2UNIX (not sure on exact name) over the offending files and see if that fixes them.

Probably still worth adding this defensive code in though if we can verify it doesn't break anything :)

Olical commented 8 years ago

http://stackoverflow.com/a/3570574/455137

artm commented 8 years ago

All these files have unix line ends, the empty lines seem to separate chunks of results from the same file. Must be a feature of this version of the plugin.

Yep, defensive code is a safe bet as long as nothing else breaks.

Olical commented 8 years ago

Oh right! What's your Ag version?

λ ag --version
ag version 0.31.0

Features:
  +jit +lzma +zlib
artm commented 8 years ago

Mine is 0.19, i stuck with Ubuntu 14.04 LTS, probably that's why. I'll see tomorrow if i can upgrade it one way or another On Jan 21, 2016 3:38 PM, "Oliver Caldwell" notifications@github.com wrote:

Oh right! What's your Ag version?

λ ag --version ag version 0.31.0

Features: +jit +lzma +zlib

— Reply to this email directly or view it on GitHub https://github.com/Olical/vim-enmasse/pull/27#issuecomment-173587462.

Olical commented 8 years ago

Closing this for now, looks like it's Ag version specific. If it's still a big problem that a few people are having maybe we can implement a workaround :smile: