Got questions, comments, patches, etc.?
Contact Jason Woofenden
gitweb
/
peach-html5-editor.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ab13f4d
)
fix cursor after removing text not-first text node
author
Jason Woofenden
<jason@jasonwoof.com>
Wed, 25 May 2016 03:20:54 +0000
(23:20 -0400)
committer
Jason Woofenden
<jason@jasonwoof.com>
Wed, 25 May 2016 03:20:54 +0000
(23:20 -0400)
editor.coffee
patch
|
blob
|
history
diff --git
a/editor.coffee
b/editor.coffee
index
a3f493b
..
0b76863
100644
(file)
--- a/
editor.coffee
+++ b/
editor.coffee
@@
-1180,14
+1180,15
@@
class PeachHTML5Editor
# figure out where cursor should land
block = @find_block_parent @cursor.n
new_cursor = find_prev_cursor_position @tree, n: @cursor.n, i: 0
# figure out where cursor should land
block = @find_block_parent @cursor.n
new_cursor = find_prev_cursor_position @tree, n: @cursor.n, i: 0
- ncb = @find_block_parent new_cursor
+ ncb = @find_block_parent new_cursor.n
if ncb isnt block
new_cursor = find_next_cursor_position @tree, n: @cursor.n, i: 1
# delete text node
@remove_node @cursor.n
# delete any inline parents
n = @cursor.n.parent
if ncb isnt block
new_cursor = find_next_cursor_position @tree, n: @cursor.n, i: 1
# delete text node
@remove_node @cursor.n
# delete any inline parents
n = @cursor.n.parent
- while n and n isnt block
+ while n? and n isnt block
+ # FIXME break if anything else in the text run is in here too
while n.children.length > 0
@move_node n.children[0], n.parent, n
@remove_node n
while n.children.length > 0
@move_node n.children[0], n.parent, n
@remove_node n