BurntSushi / wingo

A fully-featured window manager written in Go.
Do What The F*ck You Want To Public License
1k stars 86 forks source link

For workspace changes, use subsequence search rather than prefix search #104

Closed filmil closed 10 years ago

filmil commented 10 years ago

It's a bit more keyboard efficient IMHO to use subsequence search for matching workspaces rather than prefix search.

For example, if I have "Workspace 1" and "Workspace 2" (not very useful names, but left over from the previous window manager), I need to type 'workspace 2' to switch from 1 to 2.

Ideally I'd just need to type whatever sequence of characters uniquely identifies the workspace name. In the above case, I'd just need to type '2' and it would uniquely identify 'Workspace 2' because it's the only one where '2' appears somewhere in the name.

Similarly, if I had workspaces:

  1. 'quick brown fox'
  2. 'quick brown dog'
  3. 'quick drown fog' I could type 'fx' to select (1), because that's the only workspace that has characters 'f' and 'x' appear in the name in that exact sequence. 'xf' would not work, because 'x' is not followed by 'f' in any of hte 3 names.

I did a cursory search of the source code but didn't find the place where this match is happening in the few minutes I had time to look.

BurntSushi commented 10 years ago

I think SelectWorkspace is what you want:

[andrew@Liger ~] wingo-cmd --usage SelectWorkspace
SelectWorkspace (TabCompletion :: string)
        Shows a centered prompt window with a list of all workspaces.

        TabCompletetion can be set to either "Prefix", "Any" or "Multiple". When it's
        set to "Prefix", the clients can be searched by a prefix matching string. When
        it's set to "Any", the clients can be searched by a substring matching string.
        When it's set to "Multiple", the clients can be searched by multiple space-
        separated substring matching strings.

        This command may be used as a sub-command to pass a particular workspace to
        another command.
filmil commented 10 years ago

Ah, nice. Thanks.

On Mon, Jan 6, 2014 at 11:47 AM, Andrew Gallant notifications@github.comwrote:

Closed #104 https://github.com/BurntSushi/wingo/issues/104.

— Reply to this email directly or view it on GitHubhttps://github.com/BurntSushi/wingo/issues/104 .