You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I actually do not know how common this is, but I often need to work with multiple "workspace" directories that have almost identical layouts. In fact they are just clones of the same repo.
The location mode is less useful when I need to constantly switch between workspaces. Assume that I am a Linux kernel guru who keeps multiple clones of kernel in /usr/src/linux. I have been in /usr/src/linux/repo1/foo/bar/quux and it is easy for me to go there; but I still cannot go to /usr/src/linux/repo2/foo/bar/quux quickly.
There is a quite simple (at least API-wise) solution to the problem. Allow users to define multiple workspace patterns, each associated with a workspace type. The configuration can look like edit:location:workspace-patterns = [&linux-ws='/usr/src/linux/[^/]+' &freebsd-ws='/usr/src/freebsd/[^/]+']
The pattern affect the behavior of the location mode in two ways:
When recording directory history: if the directory is in a workspace, then in additional to the full path of the directory, also record a version by substituting the workspace part with the type of the workspace. For instance, if I go to /usr/src/linux/repo1/foo/bar/quux, two entries are written to the directory history: the full absolute path, and linux-ws/foo/bar/quux.
When starting location mode: if the current directory is in a workspace, then find out its type, and show entries with the same workspace type. For instance, if I am in /usr/src/linux/repo100/lorem, then all linux-ws/ entries are shown. Entries for other workspaces are not shown.
The text was updated successfully, but these errors were encountered:
I actually do not know how common this is, but I often need to work with multiple "workspace" directories that have almost identical layouts. In fact they are just clones of the same repo.
The location mode is less useful when I need to constantly switch between workspaces. Assume that I am a Linux kernel guru who keeps multiple clones of kernel in
/usr/src/linux
. I have been in/usr/src/linux/repo1/foo/bar/quux
and it is easy for me to go there; but I still cannot go to/usr/src/linux/repo2/foo/bar/quux
quickly.There is a quite simple (at least API-wise) solution to the problem. Allow users to define multiple workspace patterns, each associated with a workspace type. The configuration can look like
edit:location:workspace-patterns = [&linux-ws='/usr/src/linux/[^/]+' &freebsd-ws='/usr/src/freebsd/[^/]+']
The pattern affect the behavior of the location mode in two ways:
When recording directory history: if the directory is in a workspace, then in additional to the full path of the directory, also record a version by substituting the workspace part with the type of the workspace. For instance, if I go to
/usr/src/linux/repo1/foo/bar/quux
, two entries are written to the directory history: the full absolute path, andlinux-ws/foo/bar/quux
.When starting location mode: if the current directory is in a workspace, then find out its type, and show entries with the same workspace type. For instance, if I am in
/usr/src/linux/repo100/lorem
, then alllinux-ws/
entries are shown. Entries for other workspaces are not shown.The text was updated successfully, but these errors were encountered: