Skip to content

Conversation

@GuyShane
Copy link

I just started tetsing out ST as a replacement for emacs, and this package is awesome! Thanks for all the work you've put into it.

I just have a few updates that I've been playing with to more closely replicate the experience I'm used to and I thought I'd see if you'd like to incorporate them.

Here's a summary of the changes:

  • Add an option to remove the .. option from the list
    • I find it enough to be able to type it out, and would prefer for the first item in the list to be a file option
  • Sort the options by last access date if possible, and then alphabetically
    • I often find myself opening the same few files in a project, so it's nice if they always appear closer to the top of the list
  • Pressing backspace when the input is empty goes up a drectory
    • This is taken from emacs ido-mode behaviour, where you can travel up the directory tree by deleting the previous segment
  • Show the current directory as a placeholder
    • I found it kind of hard to see both the options and the status bar at the same time, but I do like to see which directory I'm currently looking at. This hopefully just makes that a little easier
    • It also attempts to keep the name short enough to read by replacing directories with their first letter inspired by fish shell

Feel free to make any changes, or reject them if you don't think they make sense to include.

Thanks again!

@gir-bot gir-bot added S: needs-review Needs to be reviewed and/or approved. C: settings Sublime settings files. C: source Related to source code. labels Oct 15, 2024
@facelessuser
Copy link
Owner

Show the current directory as a placeholder

  • I found it kind of hard to see both the options and the status bar at the same time, but I do like to see which directory I'm currently looking at. This hopefully just makes that a little easier
  • It also attempts to keep the name short enough to read by replacing directories with their first letter inspired by fish shell

I'm not sure what this means, can you provide a screenshot showing what this actually does?

Sort the options by last access date if possible, and then alphabetically

  • I often find myself opening the same few files in a project, so it's nice if they always appear closer to the top of the list

If we are going to do this, please add settings that exposes the previous behavior. Previous behavior should be the default. Too many people rely on previous behavior.

  1. Provide a sort setting that can be used to specify the old alphabetical or access time approach.
  2. You've slipped in an additional change where you are mixing folders with documents when sorting. Please sort documents and files separately. If you'd like to expose sorting them all together, please add a setting to enable this behavior. I'm not sure I'm sold on this, but I don't want this as the default behavior and it may not be something all people want.

Add an option to remove the .. option from the list

  • I find it enough to be able to type it out, and would prefer for the first item in the list to be a file option

This is obviously subjective. If this is accepted, the backspace addition is required. This is more for my own notes. backspace change could be accepted independent of whether .. change is accepted.

Lastly, please follow the convention of the project and add docstrings to any new functions providing the basic description of the function's behavior.

@GuyShane
Copy link
Author

Thanks for checking this out so quick! I added some changes which hopefully address your concerns, but I'm happy to make more if necessary. Here are some screenshots of what the placeholder directory looks like. I also put this behind a setting keeping the current behavior as default.

placeholder
placeholder_shortened

@facelessuser
Copy link
Owner

You will need to address lint and spelling issues. For spelling issue, just wrap the offending CWD in with backticks `CWD`.

Once completed, I will need time to consider the features and whether we want all of them. I think I'm probably okay with the placeholder and sorting. I'm not sure if I like folders mixed with documents, but I'll think about it. I might be okay with backspace but I'd need to make sure it works as expected on various platforms. Some of these keybindings can be tricky on some platforms. If we cannot allow that, we won't allow removal of ...

@GuyShane
Copy link
Author

Awesome, sounds good! Thanks so much

"fuzzy_bookmarks_load", "fuzzy_get_cwd", "fuzzy_cwv"
]:
return active
elif key == "fuzzy_go_to_parent_dir":
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry! Just realized there was a mistake in functionality here. It was navigating up a directory on every backspace. This change makes it so that it only navigates up if the input is empty

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. I haven't tested functionality yet, but that is, of course, on my list.

Changes like this require more cautious evaluation. I think I noted that I particularly wanted to make sure this feature behaves without issues, and you've just stumbled on why 🙂.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Totally agree! There's no rush or pressure on my end to get the changes merged since I can already use them locally. My goal was just to add some options that maybe other users would find helpful

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C: settings Sublime settings files. C: source Related to source code. S: needs-review Needs to be reviewed and/or approved.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants