- // Check if cursor collapsed right behind of a list.\r
- if ( previous &&\r
- previous.type == CKEDITOR.NODE_ELEMENT &&\r
- previous.getName() in listNodeNames )\r
+ // Join a sub list's first line, with the previous visual line in parent.\r
+ if ( ( previous = path.contains( listNodeNames ) ) &&\r
+ range.checkBoundaryOfElement( previous, CKEDITOR.START ) &&\r
+ ( previous = previous.getParent() ) && previous.is( 'li' ) &&\r
+ ( previous = getSubList( previous ) ) )\r
+ {\r
+ joinWith = previous;\r
+ previous = previous.getPrevious( nonEmpty );\r
+ // Place cursor before the nested list.\r
+ cursor.moveToPosition(\r
+ previous && blockBogus( previous ) ? previous : joinWith,\r
+ CKEDITOR.POSITION_BEFORE_START );\r
+ }\r
+ // Join any line following a list, with the last visual line of the list.\r
+ else\r