Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running a check without saving #28

Closed
dpavlic opened this issue Dec 18, 2014 · 13 comments
Closed

Running a check without saving #28

dpavlic opened this issue Dec 18, 2014 · 13 comments
Assignees

Comments

@dpavlic
Copy link

dpavlic commented Dec 18, 2014

Is there any possibility of running a check without saving the file? In other words, :Neomake runs the checks on the current buffer in its current state, rather than the last write?

I understand what I am asking for might not be feasible and that the file needs to be saved before it is checked depending on the checker: but maybe a possibility to specify a directory where a temporary file could be copied with the current buffer state, then deleted, and any errors reported in the buffer worked on.

This would be very useful since it would enable me to Neomake the buffer every time I, for example, enter the normal mode, without at the same time seting the buffer to autowrite every time I enter the normal mode.

@benekastah
Copy link
Collaborator

This should be pretty easy.

@benekastah benekastah self-assigned this Dec 18, 2014
@benekastah
Copy link
Collaborator

Checkout branch issue-28 if you want to use this. I haven't merged into master because I want to test it for a few days to see what issues arise.

@dpavlic
Copy link
Author

dpavlic commented Dec 30, 2014

Big thanks -- I will check this out tomorrow.

@benekastah
Copy link
Collaborator

Just merged this. I still get temp files that don't get cleaned up from time to time; not sure why that happens. But it is a minor enough issue, and not everyone will use this feature.

@benekastah
Copy link
Collaborator

Also: do :help g:neomake_make_modified to see the docs for this feature.

@dpavlic
Copy link
Author

dpavlic commented Jan 12, 2015

Thanks a million for this implementation. It works great for my purposes.

@benekastah
Copy link
Collaborator

No problem! I forgot to add one note: if you are running :Neomake pretty frequently, you might want to set g:neomake_verbose to 0. When I didn't do that, my screen would sometimes shift upward if two messages happened to get displayed in close succession.

@greyblake
Copy link

@dpavlic , @benekastah

Hi, sorry guys for disturbing you.
I can't make this work. I've added to my nvimrc:

let g:neomake_make_modified=1
autocmd! BufWritePost * Neomake

Add I get error message when I save a file, but not when I change a buffer.
Did I misunderstand the feature or do I do something wrong?
Thanks in advance.

@benekastah
Copy link
Collaborator

The issue is that the BufWritePost event only fires after saving. You need to use a different event like InsertLeave or something similar. You may still have problems because not all checkers support this feature. For that reason we are considering removing this feature.

@greyblake
Copy link

@benekastah thanks for the reply!
I've tried to use jobcontrol to trigger Neomake every second like this (the implementation is not the best one)

function s:JobHandler(job_id, data, event)
  Neomake
endfunction

let s:callbacks = {'on_stdout': function('s:JobHandler') }
call jobstart(['bash', '-c', 'while true; do sleep 1; echo test; done'], s:callbacks))

But looks like it's quite annoying) Anyway I am really excited about the Neovim and all functionality it brings us.

Thanks for the amazing plugin and the job you've done!

@greyblake
Copy link

Yea, looks like InsertLeave is better solution)

@Neki
Copy link
Contributor

Neki commented Apr 7, 2015

@greyblake g:neomake_make_modified was removed in #84, so when you update Neomake this will no longer work.

@blueyed
Copy link
Member

blueyed commented Mar 6, 2017

See #1057 for bringing it back.
It is very much required for autolinting in insert mode, that's why I am pushing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants