Git Product home page Git Product logo

Comments (4)

roberthorn avatar roberthorn commented on May 26, 2024 1

I'm not able to reproduce this in Vim. Assuming the following code:

package main

import "fmt"

func main() {
        num := 1
        fmt.Println(num)
}

doing num -> n -> num works every time.

Basically it's having trouble finding the variable from your selection.

Messing with godoctor, it seems that the -pos offset,len style isn't very consistent, I'm able to reproduce the problem with variable n with godoctor -file main.go -pos 44,1 rename num. Seems to only be a problem with single character variables.

I'm pretty sure the Vim plugin uses the -pos startrow,startcol:endrow,endcol format, which if you try godoctor with godoctor -file main.go -pos 6,5:6,5 rename num, it will work. Be wary of tabs/spaces though.

@rdallman @joverbey sound right?

from godoctor.

rdallman avatar rdallman commented on May 26, 2024 1

thanks for debugging and raising issue. should we require the startrow,startcol:endrow,endcol syntax in the api to avoid such issues in the future?

from godoctor.

microamp avatar microamp commented on May 26, 2024

Thanks I'll try the longer format as suggested. Will report back!

from godoctor.

microamp avatar microamp commented on May 26, 2024

The suggested format works much better.

-pos startrow,startcol:endrow,endcol

And now I have applied the change to the Emacs package.

@roberthorn @rdallman Thanks for helping me sort this out.

from godoctor.

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.