Commit 6b39219d authored by ninabreznik's avatar ninabreznik Committed by yann300

Add search

parent a5635e41
...@@ -297,6 +297,7 @@ function run () { ...@@ -297,6 +297,7 @@ function run () {
txlistener.startListening() txlistener.startListening()
// ----------------- editor ---------------------------- // ----------------- editor ----------------------------
this._components.editor = new Editor({}) // @TODO: put into editorpanel this._components.editor = new Editor({}) // @TODO: put into editorpanel
window.EDITOR = this._components.editor
var editor = self._components.editor // shortcut for the editor var editor = self._components.editor // shortcut for the editor
// ---------------- ContextualListener ----------------------- // ---------------- ContextualListener -----------------------
......
...@@ -6,6 +6,7 @@ var csjs = require('csjs-inject') ...@@ -6,6 +6,7 @@ var csjs = require('csjs-inject')
var ace = require('brace') var ace = require('brace')
var Range = ace.acequire('ace/range').Range var Range = ace.acequire('ace/range').Range
require('brace/ext/language_tools') require('brace/ext/language_tools')
require('brace/ext/searchbox')
var langTools = ace.acequire('ace/ext/language_tools') var langTools = ace.acequire('ace/ext/language_tools')
require('./mode-solidity.js') require('./mode-solidity.js')
var styleGuide = remixLib.ui.styleGuide var styleGuide = remixLib.ui.styleGuide
...@@ -225,6 +226,10 @@ function Editor (opts = {}) { ...@@ -225,6 +226,10 @@ function Editor (opts = {}) {
editor.gotoLine(line + 1, col - 1, true) editor.gotoLine(line + 1, col - 1, true)
} }
this.find = function (string) {
editor.find(string)
}
// Do setup on initialisation here // Do setup on initialisation here
editor.on('changeSession', function () { editor.on('changeSession', function () {
event.trigger('sessionSwitched', []) event.trigger('sessionSwitched', [])
...@@ -236,7 +241,15 @@ function Editor (opts = {}) { ...@@ -236,7 +241,15 @@ function Editor (opts = {}) {
// Unmap ctrl-t & ctrl-f // Unmap ctrl-t & ctrl-f
editor.commands.bindKeys({ 'ctrl-t': null }) editor.commands.bindKeys({ 'ctrl-t': null })
editor.commands.bindKeys({ 'ctrl-f': null }) // editor.commands.bindKeys({ 'ctrl-f': null })
editor.commands.addCommand({
name: "myCommand",
bindKey: { win: "Ctrl-L", mac: "Command-L" },
exec: function() {
editor.insert("Key binded!");
}
});
editor.resize(true) editor.resize(true)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment