654 changes: 0 additions & 654 deletions ElectronClient/gui/NoteEditor/NoteBody/AceEditor/AceEditor.tsx

This file was deleted.

48 changes: 0 additions & 48 deletions ElectronClient/gui/NoteEditor/NoteBody/AceEditor/Toolbar.tsx

This file was deleted.

60 changes: 0 additions & 60 deletions ElectronClient/gui/NoteEditor/NoteBody/AceEditor/styles/index.ts

This file was deleted.

219 changes: 0 additions & 219 deletions ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/index.ts

This file was deleted.

11 changes: 0 additions & 11 deletions ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/types.ts

This file was deleted.

178 changes: 0 additions & 178 deletions ElectronClient/gui/NoteEditor/NoteBody/AceEditor/utils/useListIdent.ts

This file was deleted.

32 changes: 4 additions & 28 deletions ElectronClient/gui/NoteEditor/NoteBody/CodeMirror/CodeMirror.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {
},
supportsCommand: (/* name:string*/) => {
// TODO: not implemented, currently only used for "search" command
// which is not directly supported by Ace Editor.
// which is not directly supported by this Editor.
return false;
},
execCommand: async (cmd: EditorCommand) => {
Expand Down Expand Up @@ -479,36 +479,12 @@ function CodeMirror(props: NoteBodyEditorProps, ref: any) {

useEffect(() => {
if (props.searchMarkers !== previousSearchMarkers || renderedBody !== previousRenderedBody) {
// SEARCHHACK
// TODO: remove this options hack when aceeditor is removed
// Currently the webviewRef will send out an ipcMessage to set the results count
// Also setting it here will start an infinite loop of repeating the search
// Unfortunately we can't remove the function in the webview setMarkers
// until the aceeditor is remove.
// The below search is more accurate than the webview based one as it searches
// the text and not rendered html (rendered html fails if there is a match
// in a katex block)
// Once AceEditor is removed the options definition below can be removed and
// props.searchMarkers.options can be directly passed to as the 3rd argument below
// (replacing options)
let options = { notFromAce: true };
if (props.searchMarkers.options) {
options = Object.assign({}, props.searchMarkers.options, options);
}
webviewRef.current.wrappedInstance.send('setMarkers', props.searchMarkers.keywords, options);
// SEARCHHACK
webviewRef.current.wrappedInstance.send('setMarkers', props.searchMarkers.keywords, props.searchMarkers.options);

if (editorRef.current) {
const matches = editorRef.current.setMarkers(props.searchMarkers.keywords, props.searchMarkers.options);

// SEARCHHACK
// TODO: when aceeditor is removed then this check will be performed in the NoteSearchbar
// End the if statement can be removed in favor of simply returning matches
if (props.visiblePanes.includes('editor')) {
props.setLocalSearchResultCount(matches);
} else {
props.setLocalSearchResultCount(-1);
}
// end SEARCHHACK
props.setLocalSearchResultCount(matches);
}
}
}, [props.searchMarkers, props.setLocalSearchResultCount, renderedBody]);
Expand Down
2 changes: 1 addition & 1 deletion ElectronClient/gui/NoteEditor/NoteBody/TinyMCE/TinyMCE.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ const TinyMCE = (props:NoteBodyEditorProps, ref:any) => {
} else if (cmd.value.type === 'files') {
insertResourcesIntoContentRef.current(cmd.value.paths, { createFileURL: !!cmd.value.createFileURL });
} else {
reg.logger().warn('AceEditor: unsupported drop item: ', cmd);
reg.logger().warn('TinyMCE: unsupported drop item: ', cmd);
}
} else {
commandProcessed = false;
Expand Down
4 changes: 1 addition & 3 deletions ElectronClient/gui/NoteEditor/NoteEditor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import * as React from 'react';
import { useState, useEffect, useCallback, useRef } from 'react';
// eslint-disable-next-line no-unused-vars
import TinyMCE from './NoteBody/TinyMCE/TinyMCE';
import AceEditor from './NoteBody/AceEditor/AceEditor';
import CodeMirror from './NoteBody/CodeMirror/CodeMirror';
import { connect } from 'react-redux';
import MultiNoteActions from '../MultiNoteActions';
Expand Down Expand Up @@ -398,8 +397,6 @@ function NoteEditor(props: NoteEditorProps) {

if (props.bodyEditor === 'TinyMCE') {
editor = <TinyMCE {...editorProps}/>;
} else if (props.bodyEditor === 'AceEditor') {
editor = <AceEditor {...editorProps}/>;
} else if (props.bodyEditor === 'CodeMirror') {
editor = <CodeMirror {...editorProps}/>;
} else {
Expand Down Expand Up @@ -466,6 +463,7 @@ function NoteEditor(props: NoteEditorProps) {
onNext={localSearch_next}
onPrevious={localSearch_previous}
onClose={localSearch_close}
visiblePanes={props.noteVisiblePanes}
/>
);
}
Expand Down
9 changes: 1 addition & 8 deletions ElectronClient/gui/NoteSearchBar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -148,14 +148,7 @@ class NoteSearchBarComponent extends React.Component {
</div>
) : null;

// Currently searching in the viewer does not support jumping between matches
// So we explicitly disable those commands when only the viewer is open (this is
// currently signaled by results count being set to -1, but once Ace editor is removed
// we can observe the visible panes directly).
// SEARCHHACK
// TODO: remove the props.resultCount check here and replace it by checking visible panes directly
const allowScrolling = this.props.resultCount !== -1;
// end SEARCHHACK
const allowScrolling = this.props.visiblePanes.indexOf('editor') >= 0;

const viewerWarning = (
<div style={textStyle}>
Expand Down
36 changes: 1 addition & 35 deletions ElectronClient/gui/note-viewer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -277,25 +277,7 @@
let selectedElement = null;
let elementIndex = 0;

const onEachElement = (element) => {
// SEARCHHACK
// TODO: remove notFromAce hack when removing aceeditor
// when removing just remove the 'notFromAce' part and leave the rest alone
if (!('selectedIndex' in options) || 'notFromAce' in options) return;
// SEARCHHACK

if (('selectedIndex' in options) && elementIndex === options.selectedIndex) {
markSelectedElement_ = element;
element.classList.add('mark-selected');
selectedElement = element;
}

elementIndex++;
}

const markKeywordOptions = {
each: onEachElement,
};
const markKeywordOptions = {};

if ('separateWordSearch' in options) markKeywordOptions.separateWordSearch = options.separateWordSearch;

Expand All @@ -307,22 +289,6 @@
replaceRegexDiacritics: replaceRegexDiacritics,
}, markKeywordOptions);
}

// SEARCHHACK
// TODO: Remove this block (until the other SEARCHHACK marker) when removing Ace
// HACK: Aceeditor uses this view to handle all the searching
// The newer editor wont and this needs to be disabled in order to
// prevent an infinite loop
if (!('notFromAce' in options)) {
ipcProxySendToHost('setMarkerCount', elementIndex);

// We only scroll the element into view if the search just happened. So when the user type the search
// or select the next/previous result, we scroll into view. However for other actions that trigger a
// re-render, we don't scroll as this is normally not wanted.
// This is to go around this issue: https://github.com/laurent22/joplin/issues/1833
if (selectedElement && Date.now() - options.searchTimestamp <= 1000) selectedElement.scrollIntoView();
}
// SEARCHHACK
}

let markLoader_ = { state: 'idle', whenDone: null };
Expand Down
1 change: 0 additions & 1 deletion ElectronClient/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,6 @@
"promise": "^8.0.1",
"query-string": "^5.1.1",
"react": "^16.9.0",
"react-ace": "^6.1.4",
"react-datetime": "^2.14.0",
"react-dom": "^16.9.0",
"react-redux": "^5.0.7",
Expand Down
7 changes: 0 additions & 7 deletions ElectronClient/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,6 @@ a {
transition: 0.3s;
opacity: 1;
}
/* By default, the Ice Editor displays invalid characters, such as non-breaking spaces
as red boxes, but since those are actually valid characters and common in imported
Evernote data, we hide them here. */
.ace-chrome .ace_invisible_space {
background-color: transparent !important;
opacity: 0;
}

.note-list .list-item-container:hover {
background-color: rgba(0,160,255,0.1) !important;
Expand Down
8 changes: 0 additions & 8 deletions ReactNativeClient/lib/models/Setting.js
Original file line number Diff line number Diff line change
Expand Up @@ -392,14 +392,6 @@ class Setting extends BaseModel {
appTypes: ['desktop'],
label: () => _('Auto-pair braces, parenthesis, quotations, etc.'),
},
'editor.betaCodeMirror': {
value: false,
type: Setting.TYPE_BOOL,
public: true,
section: 'note',
appTypes: ['desktop'],
label: () => _('Use CodeMirror as the code editor (WARNING: BETA).'),
},
'notes.sortOrder.reverse': { value: true, type: Setting.TYPE_BOOL, section: 'note', public: true, label: () => _('Reverse sort order'), appTypes: ['cli'] },
'folders.sortOrder.field': {
value: 'title',
Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/aritimDark.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const aritimStyle = {
codeBorderColor: '#141a21', // Single line code border, and tables
codeColor: '#005b47', // Single line code text

aceEditorTheme: 'chaos',
codeMirrorTheme: 'monokai',
codeThemeCss: 'atom-one-dark-reasonable.css',

Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/dark.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const darkStyle = {
codeBackgroundColor: 'rgb(47, 48, 49)',
codeBorderColor: 'rgb(70, 70, 70)',

aceEditorTheme: 'twilight',
codeMirrorTheme: 'material-darker',
codeThemeCss: 'atom-one-dark-reasonable.css',

Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/dracula.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const draculaStyle = {
codeBorderColor: '#f8f8f2',
codeColor: '#50fa7b',

aceEditorTheme: 'dracula',
codeMirrorTheme: 'dracula',
codeThemeCss: 'atom-one-dark-reasonable.css',
};
Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/light.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ const lightStyle = {
codeBorderColor: 'rgb(220, 220, 220)',
codeColor: 'rgb(0,0,0)',

aceEditorTheme: 'chrome',
codeMirrorTheme: 'default',
codeThemeCss: 'atom-one-light.css',
};
Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/nord.js
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ const nordStyle = {
codeBorderColor: nord[2],
codeColor: nord[13],

aceEditorTheme: 'terminal',
codeMirrorTheme: 'nord',
codeThemeCss: 'atom-one-dark-reasonable.css',
};
Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/solarizedDark.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const solarizedDarkStyle = {
codeBorderColor: '#696969',
codeColor: '#fdf6e3',

aceEditorTheme: 'twilight',
codeMirrorTheme: 'solarized dark',
codeThemeCss: 'atom-one-dark-reasonable.css',
};
Expand Down
1 change: 0 additions & 1 deletion ReactNativeClient/lib/themes/solarizedLight.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ const solarizedLightStyle = {
codeBorderColor: '#eee8d5',
codeColor: '#002b36',

aceEditorTheme: 'tomorrow',
codeMirrorTheme: 'solarized light',
codeThemeCss: 'atom-one-light.css',
};
Expand Down