File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed
AnkiDroid/src/main/java/com/ichi2/anki Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -2492,7 +2492,17 @@ class NoteEditorFragment :
24922492 if (note == null || addNote) {
24932493 getColUnsafe.run {
24942494 val notetype = notetypes.current()
2495- Note .fromNotetypeId(this @run, notetype.id)
2495+ val newNote = Note .fromNotetypeId(this @run, notetype.id)
2496+ editorNote?.let {
2497+ if (editorNote!! .fields.size > newNote.fields.size) {
2498+ newNote.fields = editorNote!! .fields.toMutableList()
2499+ } else {
2500+ editorNote!! .fields.forEachIndexed { i, field ->
2501+ newNote.fields[i] = field
2502+ }
2503+ }
2504+ }
2505+ newNote
24962506 }
24972507 } else {
24982508 note
@@ -2891,7 +2901,9 @@ class NoteEditorFragment :
28912901 if (! getColUnsafe.config.getBool(ConfigKey .Bool .ADDING_DEFAULTS_TO_CURRENT_DECK )) {
28922902 deckId = getColUnsafe.defaultsForAdding().deckId
28932903 }
2894-
2904+ for (f in editFields!! ) {
2905+ updateField(f)
2906+ }
28952907 refreshNoteData(FieldChangeType .changeFieldCount(shouldReplaceNewlines()))
28962908 setDuplicateFieldStyles()
28972909 }
You can’t perform that action at this time.
0 commit comments