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, |
| 166 | sel = doc.getSelection(), |
| 167 | nativeSel = sel.getNative(); |
| 168 | |
| 169 | // Text selection position might get mangled by |
| 170 | // subsequent dom modification. #8617[1] |
| 171 | if ( nativeSel.anchorNode === fillingChar.$ ) |
| 172 | { |
| 173 | bm = sel.createBookmarks2()[ 0 ]; |
| 174 | // Anticipate the removed char. |
| 175 | bm.startOffset--; |
| 176 | ™™ |
| 177 | if ( !nativeSel.isCollpased |
| 178 | && nativeSel.focusNode == fillingChar.$ ) |
| 179 | bm.endOffset--; |
| 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; |
| 186 | |
| 187 | // Restore the text selection afterward. #8617(2) |
| 188 | bm && sel.selectBookmarks( [ bm ] ); |
170 | 189 | } |
171 | 190 | } |
172 | 191 | |