-
-
Notifications
You must be signed in to change notification settings - Fork 62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cmd/govim: don't open a split when renaming things #459
Comments
Interesting. The thinking behind opening the splits was that, in a future version of We might be able to implement this feature without opening the files in the editor. However, this could present something of a source-of-truth problem, because we wouldn't necessarily be able to guarantee the undo, whereas if the files were all open in the editor we would. |
That's a cool idea. I would like that feature, but if I had to choose, I'd prefer having no splits. Typically when I'm doing some renaming, I start with a clean repo and use git to roll back unwanted changes. I'm also hopeful that gopls will support module-wide renaming soon (golang/go#32877). I use the GOPATH-wide renaming capability of gorename a fair amount for doing renames across our company's entire codebase (and I expect that we'll use a single module when we finally make that transition). For these cases, a rename might touch dozens of files.
Does opening the files mean opening splits? It wouldn't bother me if the rename opened a bunch of buffers in the background. |
Understood. So would your preference be, therefore, that these "other" files not get loaded in the editor at all?
No. There's actually a TODO to add a config option for this. One option is for the files to be opened as hidden buffers. But this would still require a |
If I understand you, you're suggesting that there are probably two possibilities for a no-split solution:
I think I'd be satisfied with either of these for now. (2) sounds cool and probably works for most of my use cases, but I'd worry that it would not work as well as (1) at some scale. It's probably not a good idea to open hundreds of buffers, say. |
Yup, your understanding is 💯% correct. Ok, will ponder this a bit. I'm erring back towards option 1 because of the scale point. That still leaves the door open for future improvements in this space. |
@cespare - I've pondered and I haven't changed my thinking; I think we should go for option 1:
Marking this as "to be done next". If anyone wants to have a go, be my guest :) |
Right now govim hard-codes opening splits for renamed files.
In general I would prefer no splits. If the purpose of the splits is to convey a sense of what changed to the user, then perhaps a brief message ("changed X instances of 'foo' to 'bar' in Y files") in the status would be enough. (But I don't find this necessary either.)
If the splits are useful for some people, perhaps they should be behind an option.
The text was updated successfully, but these errors were encountered: