Code Monkey home page Code Monkey logo

Comments (7)

Wilfred avatar Wilfred commented on July 17, 2024 2

Small Rust repro:

// old
#[cfg_attr(feature = "dox")]
bitflags! {
    pub struct AnchorHints: u32 {
    }
}

// new
bitflags! {
    #[cfg_attr(feature = "dox")]
    pub struct AnchorHints: u32 {
    }
}

Even smaller lisp repro:

;; old
foo
(x y)

;; new
(foo x y)

from difftastic.

Wilfred avatar Wilfred commented on July 17, 2024 1

Interesting, this is probably related to #30, but for the opening delimiter rather than the closing delimiter.

Thanks for the report. #30 is going to be fiddly to fix, so it might take me a while :)

from difftastic.

sdroege avatar sdroege commented on July 17, 2024

Should've added that this is with some older git version after 0.10.1 and also latest git (as of now). Main change with latest git is the addition of the slight syntax highlighting (nice btw!).

from difftastic.

Wilfred avatar Wilfred commented on July 17, 2024

@sdroege do you have the full file of before and after, or could you point me at the git repo you're using?

from difftastic.

Wilfred avatar Wilfred commented on July 17, 2024

Aha, looks like it's here: https://github.com/gtk-rs/gtk3-rs/blob/master/gdk/src/auto/flags.rs

from difftastic.

Wilfred avatar Wilfred commented on July 17, 2024

So the problem here is that difftastic prefers moving the delimiters rather than considering the attribute moved. The following program does not have the same problem:

// old
#[cfg_attr(feature = "dox")]
bitflags! {
    #[foo(bar)]
    pub struct AnchorHints: u32 {
    }
}

// new
bitflags! {
    #[foo(bar)]
    #[cfg_attr(feature = "dox")]
    pub struct AnchorHints: u32 {
    }
}

This is a really interesting case. Perhaps the cost metrics for moving delimiters should consider the first child of the list.

from difftastic.

Wilfred avatar Wilfred commented on July 17, 2024

No longer repros on trunk. There's been a bunch of improvements to list nesting recently.

from difftastic.

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.