Skip to content

Commit ca10f93

Browse files
committed
Fix source maps and undoing the first cell
1 parent 9ea4237 commit ca10f93

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

build/webpack/webpack.datascience-ui.config.builder.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ function buildConfiguration(isNotebook) {
100100
chunkFilename: `[name].bundle.js`
101101
},
102102
mode: 'development', // Leave as is, we'll need to see stack traces when there are errors.
103-
devtool: 'source-map',
103+
devtool: isProdBuild ? 'source-map' : 'inline-source-map',
104104
optimization: {
105105
minimize: isProdBuild,
106106
minimizer: isProdBuild ? [new TerserPlugin({ sourceMap: true })] : [],

src/datascience-ui/native-editor/redux/reducers/creation.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,12 @@ export namespace Creation {
217217
arg: NativeEditorReducerArg<{ id: string; changes: IEditorContentChange[] }>
218218
): IMainState {
219219
const index = arg.prevState.cellVMs.findIndex(c => c.cell.id === arg.payload.data.id);
220-
if (index) {
220+
if (index >= 0) {
221221
const newVM = { ...arg.prevState.cellVMs[index] };
222222
arg.payload.data.changes.forEach(c => {
223223
const source = newVM.uncommittedText ? newVM.uncommittedText : newVM.inputBlockText;
224224
const before = source.slice(0, c.rangeOffset);
225+
// tslint:disable-next-line: restrict-plus-operands
225226
const after = source.slice(c.rangeOffset + c.rangeLength);
226227
newVM.uncommittedText = `${before}${c.text}${after}`;
227228
});

0 commit comments

Comments
 (0)