IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
|
|
|
162 | 162 | var fillingChar = doc && doc.removeCustomData( 'cke-fillingChar' ); |
163 | 163 | if ( fillingChar ) |
164 | 164 | { |
| 165 | var bm, sel = doc.getSelection().getNative(); |
| 166 | |
| 167 | // Text selection position might get mangled by |
| 168 | // subsequent dom modification, save it now for restoring. (#8617) |
| 169 | if ( fillingChar.getLength() > 1 |
| 170 | && sel.containsNode( fillingChar.$ ) ) |
| 171 | { |
| 172 | bm = [ sel.anchorOffset, sel.focusOffset ]; |
| 173 | |
| 174 | var startAffected = sel.anchorNode == fillingChar.$, |
| 175 | endAffected = sel.focusNode == fillingChar.$; |
| 176 | |
| 177 | // Anticipate the offset change brought by removed char. |
| 178 | startAffected && bm[ 0 ]--; |
| 179 | endAffected && bm[ 1 ]--; |
| 180 | } |
| 181 | |
165 | 182 | // We can't simply remove the filling node because the user |
166 | 183 | // will actually enlarge it when typing, so we just remove the |
167 | 184 | // invisible char from it. |
168 | 185 | fillingChar.setText( fillingChar.getText().replace( /\u200B/g, '' ) ); |
169 | | fillingChar = 0; |
170 | | } |
171 | | } |
| 186 | |
| 187 | // Restore the bookmark. |
| 188 | if ( bm ) |
| 189 | { |
| 190 | var rng = sel.getRangeAt( 0 ); |
| 191 | rng.setStart( rng.startContainer, bm[ 0 ] ); |
| 192 | rng.setEnd( rng.startContainer, bm[ 1 ] ); |
| 193 | sel.removeAllRanges(); |
| 194 | sel.addRange( rng ); |
| 195 | } |
| 196 | } |
| 197 | } |
172 | 198 | |
173 | 199 | CKEDITOR.plugins.add( 'selection', |
174 | 200 | { |
… |
… |
|
191 | 217 | case 37 : // LEFT-ARROW |
192 | 218 | case 39 : // RIGHT-ARROW |
193 | 219 | case 8 : // BACKSPACE |
| 220 | case 46 : // DEl |
194 | 221 | removeFillingChar( editor.document ); |
195 | 222 | } |
196 | 223 | }, null, null, 10 ); |