flexdesk 0.9.0 → 0.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -130,7 +130,7 @@ await createShell({
130
130
  });
131
131
  ```
132
132
 
133
- ### The palette that finds anything (0.9.0)
133
+ ### The palette that finds anything (0.9.0; matching tightened in 0.9.1)
134
134
 
135
135
  Ctrl+K's grouped layout. Every option is off unless you pass it, so a shell that
136
136
  passes none of them keeps the chip strip, the panel toggles and the flat list:
@@ -158,8 +158,10 @@ A row may carry `context` (drawn, not searched), `keywords` (searched, not
158
158
  drawn), `modes` (which of `split`/`window` its keys offer), `drillLabel` (the Tab
159
159
  hint), `boost`, `group`/`groupLabel`, `kindLabel`, `shortcut` and `verb`. A group's
160
160
  header is the taxonomy's `plural` for the kind, else its `label`. Matching ranks
161
- exact, prefix, word starts (`ord li` finds *Order lines*), substring, then a tight
162
- subsequence. A drill's `search` is debounced, and a stale answer is aborted and
161
+ exact, prefix, word starts (`ord li` finds *Order lines*), substring, then an
162
+ abbreviation: it starts at a word, and the letters it skips outside word starts are
163
+ at most half the query (`cstmr` finds *customer*; `cour` does not find *Scroll up
164
+ to*). A drill's `search` is debounced, and a stale answer is aborted and
163
165
  never drawn. `palette.invalidate()` drops the cache.
164
166
 
165
167
  **`chrome.zoom`** paints a − / track / + / readout control into the element you
package/dist/wm.js CHANGED
@@ -698,6 +698,7 @@ function _match(text, query) {
698
698
  const sub = t.indexOf(q);
699
699
  if (sub >= 0) return { s: 60, hits: span(sub, q.length) };
700
700
  const flat = q.replace(/\s+/g, "");
701
+ const startsWord = (i) => i === 0 || _WORD_BREAK.test(t[i - 1]);
701
702
  const hits = [];
702
703
  let j = 0;
703
704
  for (let i = 0; i < t.length && j < flat.length; i++) {
@@ -706,9 +707,13 @@ function _match(text, query) {
706
707
  j++;
707
708
  }
708
709
  }
709
- if (j < flat.length) return null;
710
- const spread = hits[hits.length - 1] - hits[0] + 1 - flat.length;
711
- if (spread > 3 * flat.length + 6) return null;
710
+ if (j < flat.length || !startsWord(hits[0])) return null;
711
+ let spread = 0;
712
+ for (let k = 1; k < hits.length; k++) {
713
+ const gap = hits[k] - hits[k - 1] - 1;
714
+ if (gap > 0 && !startsWord(hits[k])) spread += gap;
715
+ }
716
+ if (spread > Math.floor(flat.length / 2)) return null;
712
717
  return { s: Math.max(1, 30 - spread), hits };
713
718
  }
714
719
  function _mark(text, hits) {