I use ACE Editor in my Angular5 project.
As you can see I want to validate allow and deny email in the editor.
I want to highlight each line that is duplicated.
ACE Editor can be highlighted each line like that?
Please see
this picture
Use the addMarker to add highlight to the lines you want to show a highlight.
Range = ace.require('ace/range').Range;
editor.session.addMarker(
new Range(from, start_pos, to, end_pos),
"show-highlight",
"fullLine");
Here start_pos and end_pos are the lines you would like to highlight. Add CSS to the class "show-highlight"
.show-highlight {
position:absolute;
background: yellow; //Specify the color you would like to use
}
Related
I'm new to pug i had create a sample file as shown below:
.row
.col-md-12
.tile
.row
.col-lg-6
form
.form-group
label(for='exampleInputEmail1') Email address
input#exampleInputEmail1.form-control(type='email', aria-describedby='emailHelp', placeholder='Enter email')
This code works fine but when I paste the below code:
.form-group
label(for='hii') hii
My browser keeps loading and after a few minutes it shows "This page isn’t working", but if I remove the hii label it again works properly.
I get an error saying "Invalid indentation, you can use tabs or spaces but not both"
In this case, the error message explains a lot.
In your editor make sure that you are using the setting that converts tabs to spaces, and make sure your tab space is "2". That's what pug is expecting.
To fix your file, do a search and replace from tab to two spaces.
Is there a default key binding in VSCode to wrap a selection in an HTML tag like the keyboard shortcut Shift+alt+W in Visual studio 2015? I could not find anything similar in documentation or in the default keyboard shortcuts that indicates its availability out of the box.
To automate this go to.
File > Preferences > Keyboard Shortcuts
and add this into your keybindings.json (right hand side window)
{
"key": "ctrl+shift+enter",
"command": "editor.emmet.action.wrapWithAbbreviation",
"when": "editorTextFocus && !editorReadonly"
}
You can replace ctrl+shift+enter with your own key combination.
you can use this extension:
https://github.com/Microsoft/vscode-htmltagwrap
or you can:
open the Command Palette: Command/Control+Shift+P (⇧⌘P)
type "wrap", then select "Wrap with abbreviation"
type the tag you want and press enter
Or simply search for the HTMLtagwrap extension in VScode, Make selection. Then use Alt + W. Then enter the new tag.
I am creating a uwp app and when i set my xaml code to this
<Controls:HamburgerMenu x:Name="MyHamburgerMenu" HamburgerBackground="#FFD13438"
HamburgerForeground="White"
NavAreaBackground="# FF2B2B2B"
NavButtonBackground="#FFD13438"
SecondarySeparator="White"
NavButtonForeground="White"
LostFocus="MyHamburgerMenu_LostFocus"
DisplayMode="CompactOverlay"
>
Its not changing the color of the Hamburger Panel I have tried all colors.Its still shows the default colors only.
Also even when i change the display mode it still pushes the Title Page.
I dont whats causing the issue.My Template 10 version is v1.1.10.
The issue
To set the background color of the hamburger panel, you have to use the NavAreaBackground dependency property as you did. It should work fine. The problem is the space character between '#' and the hexadecimal value 'FF2B2B2B' in your code. Just remove the space character and it will work : NavAreaBackground="#FF2B2B2B"
In your Shell.xaml.cs file just comment this line HamburgerMenu.RefreshStyles(_settings.AppTheme, true);
It should work.
I'm trying to build a live template that will work like the 'wrap in comment' live template (that puts a // before each selected line). For example, select multiple lines of text, click Code > Surround With > Single quotes (custom live template) and quotes will appear around each line.
E.g. from:
text1
text2
text3
to:
'text1'
'text2'
'text3'
Unfortunately the template I define:
'$SELECTION$'
produces:
'text1
text2
text3'
which makes sense.
Is there any way to define a Live Template that will work on each line of my selection?
"Wrap in comment" is not a live template, but an action that is implemented in Java. In the same way, you can't accomplish what you need using a live template, but you can write a small plugin in Java to implement that feature. Please refer to the Editor Basics tutorial to get started with writing the plugin.
I am using nivo slider( default theme) and I positioned the prev and next arrows next to the image(not on top of the image) and I was wondering if there is a way to always show the next and prev arrows(right now the arrows only show when you hover over the image). Seems there should be a way to edit the code to do this but I can't seem to figure out where. Thanks!
directionHideNav: false doesn't work as of 3.1.
Changes now need to be made in CSS
In the theme css file find the line
.theme-default .nivo-directionNav a
Change:
opacity: 0; to opacity: 1;
Right way is;
just change or add directionNavHide value and set it to false in nivoSlider settings.
$('#slider').nivoSlider({directionNavHide:false});
open the nivoslider js file and find
{a(".nivo-directionNav",f).hide();f.hover(function(){a(".nivo-directionNav",f).show()},function(){a(".nivo-directionNav",f).hide()}
change to
{a(".nivo-directionNav",f).show();f.hover(function(){a(".nivo-directionNav",f).show()},function(){a(".nivo-directionNav",f).show()}
Save an upload.
An easy to do it without touching the JS code is just to add a line in your CSS file:
.nivoSlider .nivo-directionNav{
display: block !important; /* ALWAYS show the arrows */
}
I'm not a big fan of !important, but if it means I don't have to adjust the js then it works for me.