Comments (16)
I'm not sure I want that feature for Sy. It would makethe sign drawing 3 times as slow for modified lines since you have to grep 2 more lines from the diff output. And that's no even counting in the overhead of comparing 2 lines for differences and using regular expressions to show these.
I'll note it for the 2.0 release anyway. When I can come up with another way I'm satisfied with I'll add it (but disabled by default).
Thanks for the feedback!
from vim-signify.
I don't think there would be any noticeable performance impact:
- the diff output is already in memory
- vim's regular expressions engine is very fast (syntax highlighting is based on regexp...)
- there is no need to use a complex comparison algorithm: you can do like vimdiff, which highlights at most one part of the line (the part of the string after the common prefix and before the common suffix)
The feature can be disabled by default, that's fine with me.
Any ETA for Sy 2.0?
from vim-signify.
Au contraire, Vim's regular expressions are known to be pretty slow. (Lots of discussions about this on vim-dev@). That's why they added a second engine. If you have a recent enough version, see :h 're'
.
I'll have a look at some other plugins to see how they do it.
There's no real ETA, but it won't be a monster release either. I still have some things on my TODO, will commit them one after the other, and when I'm satisfied, I'll tag it as 2.0 and set up a github page with a "Guide to Signify". (I think 2~3 weeks).
from vim-signify.
Okay, I'll include it.
But in the next days I'll push 1.9 first, which will be the first release, that isn't backwards-compatible, since it's removes a lot of the complicated color control mess. It will be replaced by simple custom color groups.
from vim-signify.
That's great news, I'm looking forward to it!
from vim-signify.
Current status: I yet have to find a solution that doesn't have a huge impact on performance. So unless someone else comes up with a nice solution, we won't get this feature.
from vim-signify.
I don't understand where the "huge performance impact" would come from. The :Gdiff
command (from the fugitive plugin) already does that. Do you think it is slow?
The difference here is that you wouldn't use vimdiff. But you've already done the difficult part (identify which lines are added, removed and changed). To highlight the changes, why not doing something as simple as what vimdiff does? As explained above, it considers that there is at most one change per line, and that the change spans from the first modified character to the last modified character (even if all the characters in between are the same). This is quite straightforward, you wouldn't even need to use regular expressions for that.
from vim-signify.
@ipkiss42 :Gdiff
doesn't do anything except feed a diff to vimdiff. Anyways, it sounds like you just want vimdiff except without a split. Right?
from vim-signify.
I guess so. "vimdiff" is really just a collection of certain options. One would have to add an extra system() for getting the file version from the last commit; open it; set diff options; hide the buffer in the background; open target file with or without changes; set diff options; run :diffupdate
at certain events.
This all is probably fast enough to be added, optionally. Too bad that you can't get info about changed lines from diffing buffers, ohterwise I could remove all the hunk parsing code which would result in a much faster plugin.
from vim-signify.
@justinmk I want vimdiff-like highlighting, but I don't care if it's actually implemented using vimdiff itself, or emulated by comparing lines "manually".
In this case, I don't see why you would want to go the vimdiff way: if you know that a line has changed, it seems quite easy to compare the current and original versions. Using vimdiff as a backend sounds more painful to do. But maybe I have an over-simplified vision, since I don't know how the plugin is implemented...
from vim-signify.
@ipkiss42 Well, I mean to imply that you can already get what you are asking for by simply invoking vimdiff and hiding the split.
from vim-signify.
Yes, but if I wanted that, I would call :Gdiff :)
The nice thing with Signify is that it doesn't require any action from the user.
from vim-signify.
Well, I'd prefer the vimdiff version, because it handles a lot by itself (using C instead of VimL) and doesn't bloat the plugin as much. The only annoying thing would be that there will always be a hidden buffer in :ls
, when this option gets enabled. This might upset some people using plugins that list all buffers all the time (either in tabline or statusline).
from vim-signify.
:h 'buflisted'
from vim-signify.
Yea, I'm working at a git version right now and commit it to a new branch.
EDIT: So it's kind of working in my local copy. I'll try to polish it in the next time.
from vim-signify.
Further discussion: #120
from vim-signify.
Related Issues (20)
- Unknown function: sy#start HOT 2
- Show git changes by colour HOT 1
- Visual bug HOT 1
- Jump to a line number without counting uncommited lines HOT 1
- For some files, the ~ symbol will always be displayed HOT 2
- Is it possible to color the line number instead of a sign? HOT 2
- Custom `numhl` highlightings are ignored HOT 2
- Vim-signify does not work. HOT 5
- Get "Undefined variable: g:signify_detecting" error when I start vim. HOT 1
- signify creates infinite highlight groups HOT 3
- Sign Blocks and lua file
- [Feature Request] Window borders for SignifyHunkDiff
- Support for DesignSync (dssc) version control system HOT 1
- documentation for legacy branch
- open all folds on disable signify folds
- Support environment variables in diff commands HOT 1
- `List index out of range` caused by missing priority in `sign place` output
- Error when opening hunk diff floating window on neovim HOT 1
- `Key not present in Dictionary` errors when using `g:signify_vcs_cmds` HOT 2
- fossil: -c 0 currently (<=fossil-2.23) does not work as expected (uses default number of context lines) HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vim-signify.