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

Rufo removes line after Rufo command run #10

Closed
tackeyy opened this issue Jul 25, 2017 · 8 comments
Closed

Rufo removes line after Rufo command run #10

tackeyy opened this issue Jul 25, 2017 · 8 comments
Labels

Comments

@tackeyy
Copy link

tackeyy commented Jul 25, 2017

I love this plugin. I'm facing the below problem.

https://gyazo.com/b09a5c00494a0122e5f54b19b3c195d2

Operation

  1. @test = 'test'
  2. :w
  3. line is gone

vim --version

VIM - Vi IMproved 8.0 (2016 Sep 12, compiled May 28 2017 16:17:07)
MacOS X (unix) version
Included patches: 1-604
Compiled by Homebrew

rufo version

$ bundle exec rufo -v
rufo 0.1.0

.rufo

indent_size 2
spaces_inside_hash_brace :always
align_assignments true
align_case_when true
align_chained_calls true

.vimrc

" Enable rufo (RUby FOrmat)
let g:rufo_auto_formatting = 1

" Enable format before saving
let g:rufo_format_before_saving = 1
@lucerion
Copy link
Member

Hi @tackeyy,

Thank you for reporting! I'm looking into.

@lucerion lucerion added the bug label Jul 25, 2017
@lucerion
Copy link
Member

lucerion commented Jul 25, 2017

@tackeyy one question, which version of rufo gem do you use?

@tackeyy
Copy link
Author

tackeyy commented Jul 25, 2017

@lucerion Thanks for reply.

which version of rufo gem do you use?

I use rufo 0.1.0 .

$ bundle exec rufo -v
rufo 0.1.0

@lucerion
Copy link
Member

@tackeyy thank you!

@splattael
Copy link
Member

@tackeyy @lucerion I can reproduce it with let g:rufo_format_before_saving = 1.

@lucerion
Copy link
Member

lucerion commented Jul 25, 2017

@splattael

One more case:

Steps:

  • delete any line
  • exit with wq or x
  • open file

Result:
Deleted line exists

Expected result:
Deleted line should be removed

This issue happens because code formatting starts without last changes (before file save). let g:rufo_format_before_saving = 1 is working ok with no modified files, but it loose last changes if file was modified.

@lucerion
Copy link
Member

lucerion commented Aug 7, 2017

@tackeyy issue was fixed. Please, update the plugin and use only let g:rufo_auto_formatting = 1 option (g:rufo_format_before_saving was removed). Feel free to reopen the issue if it reproduces.

Thank you for reporting!

@tackeyy
Copy link
Author

tackeyy commented Aug 8, 2017

@lucerion @splattael Thank you for fix. After I updated plugin and changed option, I confirmed that the problem is fixed!

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

No branches or pull requests

3 participants