Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(47)

Issue 2080603008: DevTools: allow codemirror softundo to work on readonly files (Closed)

Created:
4 years, 6 months ago by luoe
Modified:
4 years, 5 months ago
Reviewers:
dgozman, lushnikov
CC:
chromium-reviews, caseq+blink_chromium.org, lushnikov+blink_chromium.org, pfeldman+blink_chromium.org, apavlov+blink_chromium.org, devtools-reviews_chromium.org, blink-reviews, sergeyv+blink_chromium.org, pfeldman, kozyatinskiy+blink_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

DevTools: allow codemirror softundo to work on readonly files When entering a keyboard shortcut into a read-only doc, CodeMirror's default functionality is to set a 'suppressEdits' flag preventing actions like soft undo (Cmd+U) before letting DevTools handle the event. This CL adds a workaround for softundo in read-only files. BUG=618803

Patch Set 1 #

Patch Set 2 : Remove unnecessary callback #

Total comments: 2

Patch Set 3 : Add missing test for preserving readOnly #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+80 lines, -16 lines) Patch
M third_party/WebKit/LayoutTests/inspector/editor/editor-test.js View 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/editor/text-editor-ctrl-d-1.html View 1 2 7 chunks +47 lines, -9 lines 0 comments Download
M third_party/WebKit/LayoutTests/inspector/editor/text-editor-ctrl-d-1-expected.txt View 1 2 3 chunks +10 lines, -1 line 0 comments Download
M third_party/WebKit/LayoutTests/inspector/editor/text-editor-ctrl-d-2.html View 1 1 chunk +1 line, -6 lines 0 comments Download
M third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js View 1 2 2 chunks +21 lines, -0 lines 2 comments Download

Messages

Total messages: 8 (4 generated)
luoe
4 years, 6 months ago (2016-06-21 22:07:01 UTC) #4
dgozman
Andrey, could you please take a look? https://codereview.chromium.org/2080603008/diff/20001/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js File third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js (right): https://codereview.chromium.org/2080603008/diff/20001/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js#newcode2079 third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js:2079: this._textEditor.setState("suppressEdits", true); ...
4 years, 6 months ago (2016-06-21 22:50:15 UTC) #6
luoe
https://codereview.chromium.org/2080603008/diff/20001/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js File third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js (right): https://codereview.chromium.org/2080603008/diff/20001/third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js#newcode2079 third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js:2079: this._textEditor.setState("suppressEdits", true); On 2016/06/21 22:50:14, dgozman wrote: > Should ...
4 years, 6 months ago (2016-06-21 23:30:47 UTC) #7
lushnikov
4 years, 5 months ago (2016-06-27 15:47:52 UTC) #8
https://codereview.chromium.org/2080603008/diff/40001/third_party/WebKit/Sour...
File
third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js
(right):

https://codereview.chromium.org/2080603008/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js:970:
setState: function(key, value)
why is this public?

https://codereview.chromium.org/2080603008/diff/40001/third_party/WebKit/Sour...
third_party/WebKit/Source/devtools/front_end/source_frame/CodeMirrorTextEditor.js:973:
this._codeMirror.state[key] = value;
the "codeMirror.state" seems to be a part of CM internals (i'm not sure why it
is exposed). We should not use it

Powered by Google App Engine
This is Rietveld 408576698