Git Product home page Git Product logo

Comments (7)

XaapX avatar XaapX commented on August 23, 2024

OK I just found what the problem is, it happens when the diff somehow has empty lines, probably because of the last part about properties.

Youi just need to replace occurences of "if line[0]" with "if line and line[0]"

from modific.

gornostal avatar gornostal commented on August 23, 2024

Thank you for the solution. I will add it to the code ASAP.

from modific.

gornostal avatar gornostal commented on August 23, 2024

I could not reproduce this issue, but I made fix for it as you proposed.
Let me know if plugin works now.

from modific.

XaapX avatar XaapX commented on August 23, 2024

Thanks, I'll let you know when I get back to office.
Though I remembver I had to change 2 occurences to fix it, and once more to completely get rid of stack traces.

If it does not fix, I'll send you a patch.
Thanks anyways.

from modific.

XaapX avatar XaapX commented on August 23, 2024

Tested from office, I still have a backtrace and it fails.
So here is a patch :

--- Modific.py.orig  2013-01-14 11:12:13.000000000 +0100
+++ Modific.py 2013-01-14 11:14:16.000000000 +0100
@@ -312,17 +312,17 @@
         deleted = []

         for chunk in self.get_chunks():
             current = chunk['start']
             deleted_line = None
             for line in chunk['lines']:
-                if line[0] == '-':
+                if line.startswith('-'):
                     if (not deleted_line or deleted_line not in deleted):
                         deleted.append(current)
                     deleted_line = current
-                elif line[0] == '+':
+                elif line.startswith('+'):
                     if deleted_line:
                         deleted.pop()
                         deleted_line = None
                         changed.append(current)
                     elif current - 1 in changed:
                         changed.append(current)

Sorry for not bothering to fork and do a pull request, I'm at work and lacking time + git tools...

from modific.

gornostal avatar gornostal commented on August 23, 2024

Thanks. I should have been using startswith instead of line[0]

from modific.

gornostal avatar gornostal commented on August 23, 2024

Please, feel free to reopen this issue, if it still occurs.

from modific.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.