Giter Club home page Giter Club logo

Comments (10)

larstvei avatar larstvei commented on May 24, 2024 1

Okay, thanks. I was confused by the straight.el stuff, and thought that was downloading your config.

I'm able to reproduce it now. This is only when using the globalized mode and along with diff-hl mode. This being a user-defined globalized mode not working properly with another (not built-in) package, I don't think this is an olivetti bug.

I'll try to debug this a little, but I'm guessing that an eventual fix will be in the globalized mode.

from olivetti.

rnkn avatar rnkn commented on May 24, 2024 1

Sorry, obviously I'm lagging behind here. Glad to see you got it sorted. Thanks @larstvei :)

from olivetti.

rnkn avatar rnkn commented on May 24, 2024

Please attempt to reproduce this with emacs -Q and M-x load-file RET [PATH TO FILE]

from olivetti.

walseb avatar walseb commented on May 24, 2024

Do you mean something like this?

M-x load-file RET diff-hl.el RET
M-x load-file RET olivetti.el RET
M-x eval-expression RET (global-diff-hl-mode)
                        (define-globalized-minor-mode global-olivetti-mode
                          nil (lambda ()
                                (pcase major-mode
                                  ('minibuffer-inactive-mode)
                                  ('exwm-mode)
                                  ('mu4e-headers-mode)
                                  ('pdf-view-mode)
                                  ('image-mode)
                                  (_ (olivetti-mode 1)))))
                        (global-olivetti-mode 1)
M-x eval-expression RET (find-file "/file/under/git/vc")
M-x eval-expression RET (insert "test")
M-x save-buffer RET

from olivetti.

rnkn avatar rnkn commented on May 24, 2024

from olivetti.

larstvei avatar larstvei commented on May 24, 2024

Hi!

I use diff-hl and tried your globalized mode, and don't experience the problems you report.

However, I did experience similar issues when using git-gutter-fringe, which is a diff-hl equivalent I used before. diff-hl resolved it for me though. It is not particularly surprising if there are incompatibilities between packages that "mess with" the margins of the buffer.

Because I'm not able to reproduce it with the same combination of packages, there are a couple of things you could try. See if there is any additional package or configuration that might be the culprit; you can check this by starting Emacs with emacs -Q as @rnkn suggests (which inhibits your emacs config file to be loaded), and then follow the steps you suggested yourself @walseb. If the error persists, then make sure you have updated versions of both packages. Maybe check if you are using the melpa stable version of olivetti (I would suggest trying the non-stable).

from olivetti.

walseb avatar walseb commented on May 24, 2024

@rnkn No additional code at all? Because then it's not possible, it only happens when I define a globalized-minor-mode for it. I am running all the code above in a emacs -Q instance without any code not mentioned here if that's what you mean.

@larstvei Yeah, that's what I'm doing. I just run emacs -Q -l configIProvidedAbove.el. I'm using the latest version of olivetti published yesterday (fa9757f) and the latest version of diff-hl (a625033)

I'm running GNU Emacs 26.3 (build 1, x86_64-pc-linux-gnu, GTK+ Version 3.24.10). And actually it appears as if the bug only happens after saving and editing for the second time. I'm not sure if that's due to the latest commits, but it does happen consistently using the config above on my pc with emacs -Q.

from olivetti.

larstvei avatar larstvei commented on May 24, 2024

I just added some debugging prints in the lambda, checking what major modes and buffers were invoked. Turnes out diff-hl creates a buffer, which causes problems.

Does this fix your issue?

(define-globalized-minor-mode global-olivetti-mode
  nil (lambda ()
        (unless (string= " *diff-hl* " (buffer-name (current-buffer)))
          (pcase major-mode
            ('minibuffer-inactive-mode)
            ('exwm-mode)
            ('mu4e-headers-mode)
            ('pdf-view-mode)
            ('image-mode)
            (_ (olivetti-mode 1))))))

from olivetti.

walseb avatar walseb commented on May 24, 2024

Yeah that works, thanks a lot!

from olivetti.

rnkn avatar rnkn commented on May 24, 2024

from olivetti.

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.