mirror of
https://github.com/ankitects/anki.git
synced 2025-09-19 14:32:22 -04:00
Merge pull request #271 from Arthur-Milchior/quickerMoveTemplate
moveTemplate slightly quicker
This commit is contained in:
commit
fcfb45ccdf
1 changed files with 4 additions and 1 deletions
|
@ -397,7 +397,10 @@ update cards set ord = ord - 1, usn = ?, mod = ?
|
||||||
# generate change map
|
# generate change map
|
||||||
map = []
|
map = []
|
||||||
for t in m['tmpls']:
|
for t in m['tmpls']:
|
||||||
map.append("when ord = %d then %d" % (oldidxs[id(t)], t['ord']))
|
oldidx = oldidxs[id(t)]
|
||||||
|
newidx = t['ord']
|
||||||
|
if oldidx != newidx:
|
||||||
|
map.append("when ord = %d then %d" % (oldidx, newidx))
|
||||||
# apply
|
# apply
|
||||||
self.save(m)
|
self.save(m)
|
||||||
self.col.db.execute("""
|
self.col.db.execute("""
|
||||||
|
|
Loading…
Reference in a new issue