-
Notifications
You must be signed in to change notification settings - Fork 2
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
Combine semi-active forks into one #5
base: master
Are you sure you want to change the base?
Conversation
fix typo
…log into akarzim-feature/vim-commands
* origin/develop: fix empty .rb file opening oops ! Why was this line commented out ? fix FlogToggle function simplify return_report def update complexity after saving the buffer
Requesting a pull to vrybas:master from vrybas:onemanstartup
That's a trade-off between speed & convenience
Commit 784835d introduced a bug when you got multiple buffers opened in multiple windows. If you unplace signs in all opened windows, they're going to be placed back by `show_complexity()` only in current window. But all other windows will jump for a few pixels to the left, which is ugly. The proper fix for original bug (when even current buffer signs weren't unplaced) would be to use `*` together with `file`: ``` :sign unplace * file={fname} Remove all placed signs in file {fname}. ```
(via @alexbel) + refactor Also set `FlogDummySign` to avoid sign column 'jumps' on files, where no signs have been set.
Conflicts: README.md plugin/flog.vim
That's a lot of work! Good job. Highlighting. From user's point of view it's much easier to set
|
Yes, absolutely. Reverted this line.
There's
Hmm, highlight groups are meant to be used for this kind of tasks. But I'm ok with both. Let's gather some more opinions though. |
Looks like Vim allows to put maximum of 2 symbols in Sign Column. The solution of previous author was to show "9+" as complexity score. But it blows up on very next line with exception: Error detected while processing function ShowComplexity: line 20: ArgumentError: comparison of String with 15 failed The solution is to show maximum of 99 complexity value, even if complexity exceeds 100.
Complexity scores shown in Vim and with flog CLI were radically different. I suspect it's because, instead of analyzing actual Ruby source, RubyParser was analyzing AST instead.
Greetings,
It looks like this fork is the most active one.
In this PR I've merged valuable code from onemastartup fork, fixed
few bugs myself, and resolved conflicts with this fork.
Summary of changes
Highlighting
Use Vim standard highlighting groups. No need to use variables and
UpdateHighlighting()
calls. Colors can be set like thisWorks for me. If there's any issues, I guess they can be addressed in
the future.
Enable/Disable/Toggle functions
I've resolved conflicts in favor of
Flog*()
function names, becausethey show right away from which plugin function comes from and easier
accessible with autocomplete, like
:call Fl<Tab>
RubyParser
The whole complex method
process_defs(exp)
is gone and replaced withuse of RubyParser, which is used by Flog itself. It reduces
parsing blow-ups, but not all of them. There are some rare cases left.
Add ability to hide low and middle complexity levels
@alexbel awesome contribution. I've cherry-picked it and slightly
changed behaviour of how signs get 'placed' and 'unplaced'.
Unplace signs only in current buffer
Commit 784835d introduced a bug when you got multiple buffers opened in
multiple windows. See bed787a
Put dummy
FlogDummySign
before setting real signsThis is what vim-gitgutter also does. Without this the sign column
jumps back & forth when
show_complexity()
is executed and there'sno any signs to show.
So the whole plugin need to be refactored and there are still a few
bugs, but this can be a good start of it's new life.