Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating custom modes #21

Open
Ynhockey opened this issue Aug 3, 2020 · 1 comment
Open

Creating custom modes #21

Ynhockey opened this issue Aug 3, 2020 · 1 comment
Labels

Comments

@Ynhockey
Copy link

Ynhockey commented Aug 3, 2020

Hi, I have created a new mode for later customization, something like this (highlight rules also present):

ace.define('ace/mode/custom', ['require', 'exports', 'ace/lib/oop', 'ace/mode/text', 'ace/mode/custom_highlight_rules'], (acequire, exports) => {
	const oop = acequire('ace/lib/oop');
	const TextMode = acequire('ace/mode/text').Mode;
	const CustomHighlightRules = acequire('ace/mode/custom_highlight_rules').CustomHighlightRules;

	oop.inherits(Mode, TextMode);

	exports.Mode = Mode;
});

I have imported the custom mode file (it's not in the same dir as the other ones, which are under node_modules), and set Ace's mode to 'custom'. Unfortunately it doesn't work, and looks for the mode file somewhere else (in the project root, dist/mode-custom.js).

What is the correct way to use custom modes in the NGX wrapper?

Thanks!

@tobiasschuerg
Copy link

@Ynhockey did you find out how to do it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants