In Sublime text, by selecting multiple lines, or Ctrl+clicking multiple lines, I can edit all of them at the same time. What I would like, is that the numbers in those rows would be different; increase with each line.
Currently, for example, I would select 6 lines, press Ctrl+Shift+L to get multiple cursors on each of them, then write for example article > h1 { font-weight:normal; }, and what comes out is:
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
article > h1 { font-weight:normal; }
And from here, if I want this to apply to all elements from h1 through h6, I will edit each line manually to change the number.
So my question is, can Sublime Text output an increasing number in each line in this scenario? Or is there another, easier way of changing them manually after they had all been set to 1's?
There are several packages that help you to insert number sequence, including Text Pastry, Insert Nums and so on.
If you use Text Pastry for example, you can achieve what you want by:
Select 6 lines.
Type article > h.
Press ctrl/cmd+alt+n to open the Text Pastry command line.
Enter 1 and press enter.
Type { font-weight:normal; }.
Step 3 and 4 will insert a sequence 1, 2, ... into your current selections.
Related
I would like to activate only certain lines for editing. To do this, the other lines should be lightly grayed out. Does anyone have any idea how I can do this? So far I have only found a workaround (see the code below) that does not have the other lines grayed out and can also be selected with [Ctrl] + [A]. The danger is then that the removal works.
this.editor.layoutOverlayWidget()
this.editor.onDidChangeCursorPosition((e) => {
if (e.position.lineNumber < 3 || e.position.lineNumber > 3) {
this.editor.setPosition({
lineNumber: 3,
column: 1
});
}
});
I'm using Report Studio Version 10.2.2 and I have a question regarding value prompts.
I've got a report with a prompt page that works great. I set up a value prompt as a multi-select, check box group with default selections. I'd like to give a visual queue to the end user by changing the font color for the "Default Selections" to red.
How do you change the font color for specific display values in a value prompt?
JavaScript
You can add an HTML item before the value prompt:
<span id="MyList">
...and an HTML item after the value prompt...
</span>
<style>
.MyRedClass {
color: #ff0000;
font-weight: bold;
}
</style>
<script>
var s = document.getElementById("MyList");
var divCollection = s.getElementsByClassName("clsCheckBoxRow");
var isPositive = function(n) {
return n > 0;
}
for (var d = 0; d < divCollection.length; d++) {
switch (true) {
case isPositive(divCollection[d].innerHTML.indexOf("CORPORATION FOR PROFIT")):
case isPositive(divCollection[d].innerHTML.indexOf("CORPORATION NON PROFIT")):
case isPositive(divCollection[d].innerHTML.indexOf("INDIVIDUAL")):
divCollection[d].classList.add("MyRedClass");
break;
default:
break;
}
}
</script>
Problems:
You will need to maintain the list of default values in two places.
(Or you could abandon the Default selections property and use
JavaScript to set the defaults.)
My code looks for a class named
clsCheckBoxRow. That may not work for users using a different theme
(?). I don't know because I didn't bother testing.
If any of the default values match text that is in the HTML (other than the value -- unlikely), you'll need to make the search more specific. (like digging deeper into the DOM)
This may be challenging to upgrade to the Interactive Viewer in Cognos Analytics.
I'm trying to look through the jquery-ui.js file at the autocomplete function. I have autocomplete working just as I would like, however I would like to add a feature. I would like the color of the results to change for that single line item based on the value.
For example if the text value contains the substring test, the color of the text should be red instead of what is defined using the css color.
Found the answer. I had to edit this part of the code in the auto complete section of the file. I added a check that looked at the item.label value, if the value called for a color change I added the red style to the anchor tag (style="color:red;").
_renderItem: function( ul, item ) {
return $( "<li>" )
.append( $( "<a>" ).text( item.label ) )
.appendTo( ul );
},
Just starting with Vim and I wondered – given a Sass block like this:
.thing {
width: 100%;
color: $color1;
.nested {
height: 1rem;
}
}
If my cursor is at the 'd' within 'width', what's the quickest way to visually select the entire rule set, selector, braces and all?
At present I am using 'Shift+}' to jump to the next blank line and then 'v' for visual and 'Shift+{' to select the prior block. Any better way?
You're close. As you're already using the { and } motions to the borders of the current paragraph, just use the related text object: Vip, where V starts (linewise, but you can also use v as this text object forces this) visual mode, and ip selects the inner paragraph.
I have a YUI datatable and I am putting the following data in the table:
{key:"name", label:"name", editor: nameChoiceEditor},
{key:"group", label:"group", editor: groupChoiceEditor},
{key:"colony", label:"colony", width: 210, editor: colonyChoiceEditor},
...
Here the name column's width is set to the maximum length of characters entered for that name, and the same with group. colony's column width is set to 210 irrespective of the length of the data.
My problem is when the name column, having multiple words like "odaiah chitukuri", is showing in two lines like so:
odaiah
chitukuri
But when it is one word like "odaiahchitukuri" it is showing in a single line, meaning the column is adjusting to fit the word.
I should have the different words in sigle line. How to do that?
Have the 'breaking' spaces replace with non-breaking spaces.
Try the following:
Change:
{key:"colony", label:"colony", width: 210, editor: colonyChoiceEditor},
To:
{key:"colony", label:"colony", width: 210, editor: colonyChoiceEditor
formatter: function (el, oRecord, oColumn, oData) {
el.innerHTML = oData.replace(/ /g, ' ');
}
},
I'm not sure if your looking for a solution that will always keep the words on a single line.. but generally speaking the datatable does a good job of spacing out the columns correctly based on the content inside. In certain cases though I've definitely had to set the width of a column manually. Here is an example for a column with class appicon:
.yui-skin-sam .yui-dt tbody td.appicon {
width: 40px;
}
Bare in mind once the number of words in the column stretches past it's defined size, it will always move to the next line.
In datatable column define :
will be width:100
not width:"100px"
or width:"100"
or width:"100em"
Use width: 100
like that then its working fine for me