diff --git a/src/editor/contentState/index.js b/src/editor/contentState/index.js index cc508ca0..01f4d9de 100644 --- a/src/editor/contentState/index.js +++ b/src/editor/contentState/index.js @@ -164,11 +164,10 @@ class ContentState { matches.forEach((m, i) => { m.active = i === index }) - // console.log(startKey, endKey) const startIndex = startKey ? blocks.findIndex(block => block.key === startKey) : 0 const endIndex = endKey ? blocks.findIndex(block => block.key === endKey) + 1 : blocks.length const needRenderBlocks = blocks.slice(startIndex, endIndex) - // console.log(JSON.stringify(needRenderBlocks, null, 2), startKey, endKey) + this.setNextRenderRange() this.stateRender.partialRender(needRenderBlocks, cursor, activeBlocks, matches, startKey, endKey) this.pre2CodeMirror(true, [...new Set([cursorOutMostBlock, ...needRenderBlocks])]) diff --git a/src/editor/parser/StateRender.js b/src/editor/parser/StateRender.js index 98cf92c8..88e655b1 100644 --- a/src/editor/parser/StateRender.js +++ b/src/editor/parser/StateRender.js @@ -433,7 +433,8 @@ class StateRender { } else { result = [ text.substring(rStart, rEnd) ] } - + // fix snabbdom-to-html bug https://github.com/snabbdom/snabbdom-to-html/issues/41 + if (result.length === 1 && result[0] === '') result.length = 0 return result } // render token of text type to vdom. diff --git a/src/main/menus/edit.js b/src/main/menus/edit.js index e812b7b6..5a3681ba 100755 --- a/src/main/menus/edit.js +++ b/src/main/menus/edit.js @@ -13,7 +13,7 @@ export default { } }, { label: 'Redo', - accelerator: 'CmdOrCtrl+Y', + accelerator: 'Shift+CmdOrCtrl+Z', click: (menuItem, browserWindow) => { actions.edit(browserWindow, 'redo') }