File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -437,11 +437,22 @@ local function notify_user_on_finish(note_ids)
437437 local query = table.concat (queries , " OR " )
438438 ankiconnect .gui_browse (query )
439439
440+ local first_field = ankiconnect .get_first_field (config .model_name )
441+
440442 -- Notify the user.
441443 if # note_ids > 1 then
442444 h .notify (string.format (" Updated %i notes." , # note_ids ))
443445 else
444- h .notify (string.format (" Updated note #%s." , tostring (note_ids [1 ])))
446+ field_data = ankiconnect .get_note_fields (note_ids [1 ])[first_field ]
447+ if not h .is_empty (field_data ) then
448+ local max_len = 20
449+ if string.len (field_data ) > max_len then
450+ field_data = field_data :sub (1 , max_len ) .. " …"
451+ end
452+ h .notify (string.format (" Updated note: %s." , field_data ))
453+ else
454+ h .notify (string.format (" Updated note #%s." , tostring (note_ids [1 ])))
455+ end
445456 end
446457end
447458
You can’t perform that action at this time.
0 commit comments