sublimehq / sublime_text

Issue tracker for Sublime Text
https://www.sublimetext.com
803 stars 39 forks source link

Sidebar selection of file and or folders is lost when focusing a tab/view #301

Open titoBouzout opened 10 years ago

titoBouzout commented 10 years ago

Very weird behaviour, everytime a tab/view is focused the sidebar selection of files and folders changes ! We lose our selection.. (?)

Expected behaviour is to never trash the selection of a user. If I select one file and one folder, the selection must be there as much time as possible.

FichteFoll commented 10 years ago

I can not seem to understand or reproduce this, can you elaborate?

titoBouzout commented 10 years ago

select 3 files in the sidebar, and then keeping your selection intact. Try to change tabs, You will notice that the sidebar automatically changes the selected files to the current focused tab. . I thought there was a plugin for that. I found very invasive to lose our sidebar selections to highlight the current tab.

FichteFoll commented 10 years ago

Thanks.

I actually just noticed 2 other bugs while trying to reproduce it. Opening new issues.

titoBouzout commented 10 years ago

Thanks, I changed the severity to critical, losing the selection, is critical.

FichteFoll commented 10 years ago

It might be a bad user experience, but it is not critical in that this is required for you to be able to use ST itself.

What I think of as critical are (mainly):

This issues falls under neither of these. I agree that it's a major issue though.

titoBouzout commented 10 years ago

The couple of issues with the sidebar selection, are imo critical. You sometimes delete a file you don't notice.. and things like that.. Having to reselect everything again, is complicated. Everything to just save 1 click..

FichteFoll commented 10 years ago

Yes, deleting files you did not expect is critical, which is why #302 is critical. This one here however is not as you just "lose" the selection and files are rather not deleted. Maybe someone else has another opinion on this but I do not think this is critical.

titoBouzout commented 5 years ago

@wbond would be possible to stop this behaviour from happening? I do not ever want to lost the selection of files. This is really worrisome for me. I do understand people find it helpful, can we have a preference? I dont understand why is this a feature, really. I do not want to lost the selection of thing I click EVER. I dont know how to explain it.... I just dont want anything else but me to change the selection of files and folder... can we raise the priority of this issue in anyway please..... ? Thanks, everytime I work with large code bases this comes up and pffffffff whats the point of this? no point! to save one click? to idk dont having to click locate file? I dont get it........

titoBouzout commented 2 years ago

This still annoys me so badly, I cannot understand how anyone can find this helpfully and new bugs starting to popup from this behaviour. Like in you are trying to SHIFT CLICK and a bunch of stuff that aren't supposed to be selected are selected and so on. Its really infuriating. Please add a preference so nobody but the user ever changes the selection of files/folders on the sidebar. Maybe add an api to allow plugins to do so too, but do not force this disruptive behaviour on everyone.

titoBouzout commented 7 months ago

@BenjaminSchaaf can this be looked into? SHIFT/CTRL+CLICK on a folder, it's just kinda impossible to do which prevents refactoring on the editor.

https://github.com/sublimehq/sublime_text/assets/64156/a74a4e2e-8834-4d77-a701-76ec4b4c0daa

BenjaminSchaaf commented 7 months ago

@titoBouzout Selection of files and folders are mutually exclusive because most commands don't accept a mix of files and folders. Though I'm not sure how you're able to select files while folders are selected, what version are you running?

titoBouzout commented 7 months ago

@BenjaminSchaaf I do not use any of the built-in commands, I use Sidebar Enhancements. Mixture of files and folders in SE is not an issue.

Can you please use the following methods instead, to disable/hide the menu items when ST can't handle the selection?

def is_enabled(self, paths=[]):
def is_visible(self, paths=[]):

I want the selection of files and folder to behave normally.

If I CTRL click files and folders, it should just add/toggle to the selection. if I SHIFT+CLICK, it should just select all in between. It should work just like in explorer. Preventing the selection is very disruptive and pretty weird.

I am using 4168

repro:

  1. click "push.bat" image

  2. hold shift and click "edit" image

Problem: This is not what I expected. I expected anything between "push.bat" and "edit" to be selected.

  1. hold shift again and click "push.bat"
    image

  2. now hold ctrl and click "bin" image

Problem: I lost the selection of the files. As you can see, dealing with this is very frustrating. You cannot use the editor to refactor the hierarchy. Then you go to explorer, and you have odd issues with files being used by lsp or ST itself. So it complicates everything, really. I have to close ST.

What would be even better is if the selection never changes unless I change it myself. I honestly dont see the point on switching tabs and having the file selected change, it trashes my own selection and there's really no point. One can use a command like "reveal" or "locate" to find the focused tab in the sidebar. A preference would be amazing.

Thanks

BenjaminSchaaf commented 7 months ago

What refactoring are you doing on files and folders in the side bar?

Then you go to explorer, and you have odd issues with files being used by lsp or ST itself.

I assume you're using Windows? File locking is global, so I'd expect ST itself to be blocked from doing certain operations in exactly the same way explorer is. Is that not what you're seeing?

titoBouzout commented 7 months ago

What refactoring are you doing on files and folders in the side bar?

Just renaming/moving many files/folders at mostly the same time to improve organization of things in a project, a refactoring of the structure. Many of these files I have them open in tabs.

Sidebar Enhancements will update/retarget all the affected tabs on all windows, so everything stays intact, doesn't matter how (cut, paste, move, rename) or where I move them. If I have to close ST to move things, then I lose all my windows and tabs with its scroll positions; and the tabs that open when I start it again are all in the wrong location, so I have to close them without saving. I would prefer to move files inside the editor rather than using explorer for mostly this reason. Besides, in a multimonitor setup ST will not restore windows on its proper screen, location, and size.

I assume you're using Windows?

Yes, I am on Windows.

File locking is global, so I'd expect ST itself to be blocked from doing certain operations in exactly the same way explorer is. Is that not what you're seeing?

It is mostly the other way around. I'm not getting blocked when working inside ST, SE retargets all files affected by file/folder renames/moves, so I guess LSP kills the processes and start new ones for these. What happens sometimes is that I need to close ST to install/remove/upgrade npm packages via the command line.

I would really appreciate if the selection could behave normally and the ability to turn off auto select file in sidebar when switching tabs.

deathaxe commented 7 months ago

...File locking is global, so I'd expect ST itself to be blocked from doing certain operations in exactly the same way explorer is.

Please note ST's git library itself is holding locks on files and/or folders, which causes neither ST nor Explorer being able to delete or move folders.

see: https://github.com/sublimehq/sublime_text/issues/3124

titoBouzout commented 7 months ago

FWIW I go with show_git_status: false

titoBouzout commented 7 months ago

@BenjaminSchaaf Can the suggestion of using is_enabled and is_visible be considered to fix this selection problem? Thanks!

def is_enabled(self, paths=[]):
def is_visible(self, paths=[]):