Commit graph

87 commits

Author SHA1 Message Date
Henrik Giesel
fb497ea2e6 Reintroduce false removed limits 2021-01-16 17:38:02 +01:00
Henrik Giesel
915cde892b Lift the 365 limit from rated/resched searches 2021-01-16 15:08:15 +01:00
Henrik Giesel
682ab23482 Fix issues after rebasing 2021-01-16 13:07:35 +01:00
Henrik Giesel
0c71487973 Pass in the the negative offset day to write_rated 2021-01-16 12:44:59 +01:00
Henrik Giesel
401796ffbe Port prop:rated to EaseKind 2021-01-16 12:44:03 +01:00
Henrik Giesel
6da38dc719 Add nonfunctional "prop:rated" as possible search query 2021-01-16 12:42:06 +01:00
Damien Elmes
96bd39f13e search error tweaks
- use markdown instead of HTML, to make editing and translating easier
- use a shared prefix
- a few very minor wording tweaks
- we don't need to translate undocumented command errors
- share a string for positive number of days
- share a string for invalid property and state arguments, and avoid
listing them out

Related discussion: https://github.com/ankitects/anki/pull/922
2021-01-16 15:59:19 +10:00
RumovZ
bdb7948406 Add resched error tests 2021-01-15 10:57:55 +01:00
RumovZ
b9f7643100 Merge branch 'master' into search-errors
Add error support for new resched node, update rated error.
2021-01-15 10:50:02 +01:00
RumovZ
9d641bcb76 Include context in search error test 2021-01-15 09:09:54 +01:00
RumovZ
e0168c8216 Encode HTML entities in search errors 2021-01-14 23:02:39 +01:00
RumovZ
6f8a9ba2ff Add search context for certain error kinds 2021-01-14 22:40:07 +01:00
RumovZ
74c2ce8df1 Rename ParseErrorKind to SearchErrorKind 2021-01-14 22:00:52 +01:00
RumovZ
6cbb4b48b2 Add errorkind test 2021-01-14 19:10:12 +01:00
RumovZ
8c6fbd828d Add FailKinds for unopened/unclosed groups 2021-01-14 19:09:31 +01:00
RumovZ
ae22b78534 Make AnkiError::SearchError work with ParseError
Use mock ftl strings for now.
2021-01-14 11:14:55 +01:00
RumovZ
5e971759cf Fix text node parsers, add FailKind alias 2021-01-14 11:10:33 +01:00
RumovZ
6c66da5578 Expect backslashes to be escaped in dupe: text 2021-01-14 10:42:37 +10:00
RumovZ
530cfebe19 Fix writing dupe nodes
Rename comments and dupe functions on the backend accordingly to avoid
further confusion.
2021-01-14 10:42:37 +10:00
RumovZ
97ed75a322 Optimise term parsers 2021-01-13 14:15:57 +01:00
RumovZ
5fc24ddfde Move parse errors, add helper func for parse fail 2021-01-13 13:23:25 +01:00
Henrik Giesel
28c53a410a Rename EaseKind values 2021-01-13 11:41:48 +01:00
RumovZ
c9b9c73f5e Fix top-level search errorkinds 2021-01-12 17:32:26 +01:00
RumovZ
c95a592891 Switch parser to custom erros and results 2021-01-12 10:43:12 +01:00
Henrik Giesel
1e74e79a1f Coerce resched:days as well 2021-01-11 17:25:42 +01:00
Henrik Giesel
fc52046808 Remove EaseKind impl in favor of transforming to sql in function 2021-01-11 17:10:17 +01:00
Henrik Giesel
fe15df1c4f Introduce "resched:n" instead of 0 and a flag for "rated" 2021-01-11 16:40:30 +01:00
Henrik Giesel
08e6f5982e Modify default behavior of rated searches to exclude manual 2021-01-11 16:40:30 +01:00
Damien Elmes
4b98ce0145 Merge pull request #917 from hgiesel/querynozero3
Coerce added/edited:0 to 1, Constrain rated:n to 1-365
2021-01-11 16:24:12 +10:00
Henrik Giesel
027677ac6d Remove coercion in write_rated 2021-01-10 16:23:53 +01:00
Henrik Giesel
d7513fd33d Coerce added/edited:0 to 1, constrain rated:n to 1 <= 365 2021-01-10 16:16:17 +01:00
RumovZ
455b693623 Provide filter searches through backend 2021-01-09 10:50:08 +01:00
RumovZ
ac4d254793 Merge branch 'master' of https://github.com/ankitects/anki into norm-search 2021-01-06 20:57:24 +01:00
RumovZ
1c257047b6 Implement replace_search_term 2021-01-06 14:03:43 +01:00
abdo
85a1c732db Rename prop:order to prop:pos 2021-01-02 13:35:10 +03:00
abdo
ab8736b37f Support prop:order to search for new cards by order 2021-01-01 04:36:51 +03:00
Damien Elmes
5a87175127 fix clippy error in unit test 2020-12-31 09:48:05 +10:00
cecini
77a94c8a45 Update rslib dep nom 2020-12-15 08:19:52 +00:00
RumovZ
6c3c617b64 Comment fix 2020-11-27 22:12:36 +01:00
RumovZ
59bbbd53b8 Revert implementation of r: prefix 2020-11-27 22:10:37 +01:00
Damien Elmes
775dae874d fix new Clippy lints 2020-11-25 09:12:19 +10:00
RumovZ
6290e09b89 Implement the prefix r: to search for raw input 2020-11-18 22:26:51 +01:00
RumovZ
add3fea6c3 Make - escapable
Treat unescaped - as before but make it escapable with \ to distinguish
the literal from the negator.
2020-11-17 18:38:27 +01:00
RumovZ
64bf14f1e9 Split unescaping between parser and writer
* Unescape wildcards in writer instead of parser.
* Move text conversion functions to text.rs.
* Implicitly norm when converting text.
* Revert to using collection when comparing tags but add escape support.
2020-11-17 12:49:37 +01:00
RumovZ
c4bea9e3c0 Use enforced re to parse deck
Fix write_deck not recognising escaped deck name separators:
\:\: -> ::
2020-11-15 21:32:36 +01:00
RumovZ
065d9e939b Annotate RegEx for invalid-escape check 2020-11-15 14:22:16 +01:00
RumovZ
e1ddc3d63a Extend tests for new search parsing
(Also fix indentation)
2020-11-15 12:00:20 +01:00
RumovZ
6d4d1369d4 Fix escape check for escaped backslash 2020-11-15 11:57:11 +01:00
RumovZ
2e54817870 Move whitespace check for tags from to sqlwriter
Instead of not parsing a tag containing whitespace, check for spaces
when writing sql and if there are any, explicitly match nothing.
2020-11-15 11:54:21 +01:00
RumovZ
022efd5956 Always use regex for tag search
Don't distinguish between the glob and no-glob cases when comparing
tags but always use regexp. Thus, avoid problems with SQL wildcards in
registered tags.
2020-11-15 09:52:00 +01:00