char *path = strrchr(desc, '@');
char *colon = strrchr(desc, ':');
- /* Discard hashes inside a DESKTOP_SEL */
+ /* Discard hashes inside a DESKTOP_SEL, e.g. `newest#@prev#older:/1/2` */
if (hash != NULL && colon != NULL && path != NULL &&
path < hash && hash < colon) {
if (path > desc && *(path - 1) == '#') {
}
}
+ /* Discard colons within references, e.g. `@next.occupied:/#any.descendant_of.window` */
+ if (colon != NULL && hash != NULL && colon < hash) {
+ colon = NULL;
+ }
+
node_select_t sel = make_node_select();
if (!parse_node_modifiers(colon != NULL ? colon : desc, &sel)) {