Fix display of all notes results

This commit is contained in:
Kovid Goyal 2023-09-27 14:03:43 +05:30
parent efeb345edd
commit 25fdaa735b
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 3 deletions

View File

@ -371,10 +371,10 @@ class Notes:
if snippet_size is None:
snippet_size = 64
char_size = snippet_size * 8
query = 'SELECT {0}.id, {0}.colname, {0}.item, substr({0}.searchable_text, 9, {1}) FROM {0} '.format('notes', char_size)
query = 'SELECT {0}.id, {0}.colname, {0}.item, substr({0}.searchable_text, 0, {1}) FROM {0} '.format('notes', char_size)
if restrict_to_fields:
query += ' WHERE notes_db.notes.colname IN ({})'.format(','.join(repeat('?', len(restrict_to_fields))))
query += ' ORDER BY ctime DESC'
query += ' ORDER BY mtime DESC'
if limit is not None:
query += f' LIMIT {limit}'
for record in conn.execute(query, tuple(restrict_to_fields)):

View File

@ -24,7 +24,7 @@ def current_db() -> Cache:
class NotesResultsDelegate(ResultsDelegate):
add_ellipsis = False
add_ellipsis = True
emphasize_text = False
def result_data(self, result):