How to get Prettier to keep ending symbol of ending tag on the same line - prettier

For some reason, when I use an emmet abbreviation like this: div>button.round-button+button>i.fas.fa-icons
and I save the file to trigger the Prettier formatter, it will format it like this:
<div>
<button class="round-button"></button
><button><i class="fas fa-icons"></i></button>
</div>
But, on the third line, I don't want the line to start with the end of the first button tag
I've done a quick look through settings but I didn't find anything relating to this. Is there a setting I can change or would it be best to give feedback to Prettier?

Adding whitespace between the button tags is unsafe. It affects the output in the browser. Either add this whitespace manually if you need it or use the htmlWhitespaceSensitivity option if you don't care about the safety of the formatting.

Related

Sublimetext "Close Tag" command doesn't work with Django static tags

For some reason, when I am programming in SublimeText with Python / Django,%} tags interfere with Sublime's 'Close Tag' function.
Here's an example of what I'm talking about in practice. It's an <img> tag that references a static file within an outer <div>. Notice that the %} tag is white — Sublime has, for some reason, not recognized it as valid code:
When I position my cursor at the other end of this line and use the 'Close Tag' command, I would expect sublime to close my </div>. Instead, it does this:
Any idea how to fix this problem?

Search/replace in block selection in Notepad++

Is there a way to limit search/replace only to a columnar block selection in Notepad++?
Here is what I am trying to do:
I am bulk-editing metadata extracted from large numbers of photos.
The metadata comes to me as a csv file with no quotes around fields in header line and no quotes around first field in each succeeding line.
I edit this file in Open Office calc which exports with quotes around all fields.
I can easily edit header row but the problem comes in stripping quotes from only first field in successive lines.
I can use notepad in columnar mode but, after selecting the first column, the 'search only in selection' option box is greyed out.
I can do this by hand but it means lots of hand-work and increased chance of error.
I know, this probably won't help you any more, but I just had the same problem and stumbled across this question.
I found moving the block in question to a new file and performing the find/replace there works quite decently. When moving the block back, be sure to select it in block mode (see this question).
No. Another editor may have this feature.
sort of a late reply but... I had the same problem when I moved to a new machine with Notepad++ installed. Previously, I was using a text editor called Boxer that had this feature, which I found invaluable. Its not free-ware however.
You may not be able to Search/Replace within a columnar selection, but you can easily carry out your task within Notepad++. Use Find and Replace feature, with the Regular Expressions box checked.
If you want to remove quotes only from a target column, use the following regular expression in the Find field:
(^([^,]*,){i})"([^,\n\r]*)"(.*$)
Replace i with the position of the target column minus 1.
(i.e.- Us 2 if you want quotes around the third column, 0 for the first column, etc)
In the Replace field use:
\1\3\4
Clicking "Replace All" will strip quotes from the target column.
If you want to blow away all quotes surrounding each element in your csv without prejudice, use the following regular expression in the Find field:
((?<=,)|(?<=^))"(.*?)"((?=$|,))
In the Replace field use:
\1\2\3
Clicking Replace All will strip quotes form the columns.
Example
Since you didn't provide an example csv file, I'll walk through my own working example. Below is my csv:
"0","1","2","3","4","5","6","7","8","9"
"10","11","12","13","14","15","16","17","18","19"
"20","21","22","23","24","25","26","27","28","29"
"30","31","32","33","34","35","36","37","38","39"
"40","41","42","43","44","45","46","47","48","49"
"50","51","52","53","54","55","56","57","58","59"
"60","61","62","63","64","65","66","67","68","69"
"70","71","72","73","74","75","76","77","78","79"
"80","81","82","83","84","85","86","87","88","89"
"90","91","92","93","94","95","96","97","98","99"
"100","101","102","103","104","105","106","107","108","109"
"110","111","112","113","114","115","116","117","118","119"
"120","121","122","123","124","125","126","127","128","129"
"130","131","132","133","134","135","136","137","138","139"
"140","141","142","143","144","145","146","147","148","149"
"150","151","152","153","154","155","156","157","158","159"
"160","161","162","163","164","165","166","167","168","169"
"170","171","172","173","174","175","176","177","178","179"
"180","181","182","183","184","185","186","187","188","189"
"190","191","192","193","194","195","196","197","198","199"
If I wanted to remove quotes from the second column, I would use the below Find and Replace fields
(^([^,]*,){1})"([^,\n\r]*)"(.*$)
\1"\3"\4
Clicking Replace All yields the below result:
"0",1,"2","3","4","5","6","7","8","9"
"10",11,"12","13","14","15","16","17","18","19"
"20",21,"22","23","24","25","26","27","28","29"
"30",31,"32","33","34","35","36","37","38","39"
"40",41,"42","43","44","45","46","47","48","49"
"50",51,"52","53","54","55","56","57","58","59"
"60",61,"62","63","64","65","66","67","68","69"
"70",71,"72","73","74","75","76","77","78","79"
"80",81,"82","83","84","85","86","87","88","89"
"90",91,"92","93","94","95","96","97","98","99"
"100",101,"102","103","104","105","106","107","108","109"
"110",111,"112","113","114","115","116","117","118","119"
"120",121,"122","123","124","125","126","127","128","129"
"130",131,"132","133","134","135","136","137","138","139"
"140",141,"142","143","144","145","146","147","148","149"
"150",151,"152","153","154","155","156","157","158","159"
"160",161,"162","163","164","165","166","167","168","169"
"170",171,"172","173","174","175","176","177","178","179"
"180",181,"182","183","184","185","186","187","188","189"
"190",191,"192","193","194","195","196","197","198","199"
My search on internet, to to see weather notepad++ suports this; brought me here.
I have used TextPad and confirm that it supports find-and-replace within column selected block. Also TextPad is free for personal use.

WriteOutput doesn't produce carriage return line feed in the html source

This is being too picky, but hey...
If I use the WriteOutput command in cfscript, it doesn't put a carriage return/line feed in the output.
Q: Is there a WriteOutputln() or something like that?
Right now, I manually add Chr(13) & Chr(10) just to format the source code all pretty.
It doesn't really make sense to have a writeOutputLn() function in the language as most output is targeted at a browser, and CRLFs don't actually render in a browser, so what would the point be? One could then say "OK, well put a <br> there instead". That makes it no use for situations other than when outputing mark-up. And should it be a <br> or a <br/>? or a <br />? That's very picky, but it just goes to show that there's no realy single equivalent that is "correct" behaviour.
That and writing a UDF is so simple - and can be finetuned to the situation it's used in - there's just no point.
I reckon that answers your question as to why it's not in the language.

Making Dreamweaver more like Notepad++

I'm moving to Dreamweaver from Notepad++, and while Dw does have many better features than Notepad++, there are a few that I'm really missing.
Is there a way to make the "Home" key on the keyboard take you to the front of where the code starts, instead of the very front of the line? In Notepad++ this is how it works by default, and I don't know why anyone would want to go to the very front of the line instead of the front of the code. I use tabbing to keep it more organized, so this feature is really important to me.
How do I duplicate a line in Dw? In Notepad++ I can select the line and press ctrl + d and it automatically duplicated the code. This is awesome for something like a gallery or a table where I don't want to have to type out every line because it's so similar.
Less important, as I don't use this that often, but can you vertically select in Dw? In Notepad++ you can hold down alt and select lines vertically. Ex:
http://dl.dropbox.com/u/12147973/vert-select.jpg
Thanks in advance.
For #2, check out the Code Extras extension for Dreamweaver
No Longer works in DW5.5; Try here - http://yoropan.com/en/archives/544
I was also wanting some of this features... I discovered that, at least in CS6, #2 is already in Dreamweaver, but the shortcut is Ctrl+Alt+Down ou Up, depending on the direction that you wanna duplicate the code.
Note that I had to disable the shortcut that turns your screen view for that to work. (It's an intel default, press Ctrl+Alt+f12 to open the options)
And tãa dãaa... IT WORKS! :D
I want to say one thing different. My Dreamweaver theme (Users who use Dreamweaver after use Notepad++). Download Dreamweaver.xml
"Dreamweaver.xml" file is in here for windows: C:\Program Files\Notepad++\themes\Dreamweaver.xml
The answer to #1 = Ctrl+Home in anything in windows will take you to the absolute start of the documents, same as Ctrl+End, Home and End to start and finish of lines, Ctrl+Left or Right arrow to jump entire words...
I too am on the quest for duplicating lines in DW. #3 your image no longer shows.
If I want to duplicated a line I click on the line number, then CTRL+C to copy and CTRL+V to paste. Is that what you're looking for or am I being simple?

Regular Expression Carriage Return Find & Replace on Google Docs

On Google Docs, I want each list-item (my bullet is an en dash, "-"), of which there are over 1,000 in 20 or so documents, to be separated by an additional line feed. It makes it easier to read on mobile devices.
How can I search for a line feed delimiting a bullet, and replace it with two line feeds?
(I.e. the equivalent of searching for "^p-" and replacing it with "^p^p-" in Microsoft Word)
I am a little confused about your question, but:
I found the only way to do something like this is to go to find each - or space (which Google Docs will find) and insert a "dummy" character.
Then do a search and replace with ,
Then copy all, delete all, go to the html mode and paste it.
Go back to normal view and you should have an extra space after each.
If you are trying to do this:
(I.e. the equivalent of searching for "^p-" and replacing it with "^p^p-" in Microsoft Word)
Go to html mode, and find out which tag is causing the line break, (could be div tag or a br tag (I can't get the tag characters <> to show), copy it, go back to normal mode, paste all,use copy and replace on whatever it was (br, or div) with two of them, copy, delete, paste back in html, and you should have the extra line break. Hope that helps.