mirror of
https://github.com/bilawalsidhu/gods-eye-view.git
synced 2026-11-19 17:52:21 +00:00
Run "everything except" on Enter, keep every layer it names, and keep plans for places
"hide everything except flights" runs on Enter, as asked in so many words.
A layer to keep written with "the" is read ("except flights and the
radio"), and one that is not read switches nothing off: only Ask GEV is
offered. A keyword before the rest of a name only drops its plan when that
rest starts with a word for a kind of place ("Fire Island"), so
"earthquakes japan" and "flights London" keep theirs. "Saint Vincent and
the Grenadines" stays one place with its "the".
Co-authored-by: Manjunath Paparaju <[email protected]>
This commit is contained in:
1 parent
84d79f5c76
commit
25d33a2e6f
5 files changed
+65
-17
No files matched your search
+12
-4
@@ -402,8 +402,16 @@ const COMPOUND_PLACES = new Set([
|
||||
'dadra and nagar haveli',
|
||||
'brighton and hove',
|
||||
]);
|
||||
const isCompoundPlace = (first, second) =>
|
||||
COMPOUND_PLACES.has(`${first} and ${second}`.toLowerCase());
|
||||
/**
|
||||
* The joining words of a compound place ("and", or "and the" when "the" was
|
||||
* read off the second part: "Saint Vincent and the Grenadines"), or null.
|
||||
*/
|
||||
const compoundJoin = (first, second) =>
|
||||
COMPOUND_PLACES.has(`${first} and ${second}`.toLowerCase())
|
||||
? ' and '
|
||||
: COMPOUND_PLACES.has(`${first} and the ${second}`.toLowerCase())
|
||||
? ' and the '
|
||||
: null;
|
||||
|
||||
/**
|
||||
* Lower case one character at a time, so the line keeps its length and
|
||||
@@ -598,8 +606,8 @@ export function parseOmnibar(
|
||||
place &&
|
||||
afterPlace &&
|
||||
(separator === 'and' || separator === '&') &&
|
||||
isCompoundPlace(place.split(', ').at(-1), value);
|
||||
if (joinsName) place += ` and ${value}`;
|
||||
compoundJoin(place.split(', ').at(-1), value);
|
||||
if (joinsName) place += `${joinsName}${value}`;
|
||||
else if (place && bare && afterBarePlaceAnd) place += ` and ${value}`;
|
||||
else if (place && !afterPlaceComma) {
|
||||
if (separator === 'and') extraPlaces.push(value);
|
||||
|
||||
Reference in new issue
Block a user