indentation

Indenting only the first line of text in a paragraph?

旧街凉风 提交于 2019-12-18 11:40:16
问题 I have several paragraphs that I would like to indent, although only the first lines of these paragraphs. How would I target just the first lines using CSS or HTML? 回答1: Use the text-indent property. p { text-indent: 30px; } jsFiddle. 回答2: In addition to text-indent, you can use the :first-line selector if you wish to apply additional styles. p:first-line { color:red; } p { text-indent:40px; } http://jsfiddle.net/Madmartigan/d4aCA/1/ 回答3: Very simple using css: p { text-indent:10px; } Will

How to control indentation after an open parenthesis in Emacs

断了今生、忘了曾经 提交于 2019-12-18 11:21:30
问题 When I use emacs python-mode, if the last character of a line is an open parenthesis it indents the next line just one step in from the indentation of the previous line. call_some_function( some_very_long_argument_that_I_want_to_put_on_its_own_line) I like that. Now in ecmascript-mode (which I am using for actionscript 3), it always indents to the level of the previous parenthesis. call_some_function( this_is_not_really_saving_me_any_horizontal_space); How can I make ecmascript-mode indent

How do I parse indents and dedents with pyparsing?

人盡茶涼 提交于 2019-12-18 11:12:03
问题 Here is a subset of the Python grammar: single_input: NEWLINE | simple_stmt | compound_stmt NEWLINE stmt: simple_stmt | compound_stmt simple_stmt: small_stmt (';' small_stmt)* [';'] NEWLINE small_stmt: pass_stmt pass_stmt: 'pass' compound_stmt: if_stmt if_stmt: 'if' test ':' suite ('elif' test ':' suite)* ['else' ':' suite] suite: simple_stmt | NEWLINE INDENT stmt+ DEDENT (You can read the full grammar in the Python SVN repository: http://svn.python.org/.../Grammar) I am trying to use this

Indentation sensitive parser using Parslet in Ruby?

断了今生、忘了曾经 提交于 2019-12-18 10:56:18
问题 I am attempting to parse a simple indentation sensitive syntax using the Parslet library within Ruby. The following is an example of the syntax I am attempting to parse: level0child0 level0child1 level1child0 level1child1 level2child0 level1child2 The resulting tree would look like so: [ { :identifier => "level0child0", :children => [] }, { :identifier => "level0child1", :children => [ { :identifier => "level1child0", :children => [] }, { :identifier => "level1child1", :children => [ {

Notepad++: disable auto-indent after empty lines

戏子无情 提交于 2019-12-18 10:48:42
问题 I find the autoindent style of Notepad++ a little weird: when I am typing on an indented line, I do want it to indent the next line after I press Enter (this it does properly). However, when I am on an empty line (no indentation, no characters) and I press Enter, it indents the next line, using the same indentation as the last non-empty line. I find this extremely annoying; have you ever encountered this problem and do you know how to fix it? (Note: I'm editing HTML/PHP files.) (Also,

How can I add auto indentation to UITextView when user type new line?

橙三吉。 提交于 2019-12-18 09:07:21
问题 How can I add auto indentation to UITextView when user type new line? Example: line1 line2 <user has typed "Enter"> <cursor position> line3 <user has typed "Enter"> <cursor position> 回答1: Although it seems as if the OP isn't in fact looking for standard indentation in this case, I'm leaving this up for future answer seekers. Here's how you can automatically add an indent after every newline entry. I've adapted this answer from my similar recent answer about automatically adding bullet points

How can I indent code in the Vim editor on Windows?

一曲冷凌霜 提交于 2019-12-18 07:14:34
问题 Duplicate: How to indent a selection in gvim (win32)? How do I indent multiple lines quickly in vi? Using vim under linux I can indent a block of code using the VISUAL mode and pressing ">". In vim under Windows this does not happen. This is what happens: Press V, the VIM enter in the VISUAL mode Press 'Down', the VIM exit for the VISUAL mode. I can't select anything in VISUAL mode. Alternatively, if I use the SELECT mode for selecting code the ">" does not indent it. 回答1: Haven't you keep

Indent text in xml serialization of string property?

蹲街弑〆低调 提交于 2019-12-18 06:56:59
问题 I have a string property which will contain text with newlines. This text has some of the properties of HTML text in that whitespace is disregarded. If I serialize this type using XML serialization, the newlines are serialized properly, but the indentation is "wrong". I want the serialization process to indent the lines to keep the formatting of the XML, since those whitespace characters will be disregarded later anyway. Here's an example LINQPad program: void Main() { var d = new Dummy(); d

Git Diff Indent/Pretty Print/Beautify Before Diff

北城以北 提交于 2019-12-18 05:54:14
问题 Is there a way to make Git indent /beautify/pretty print two versions of C++ source files before diffing them? I don't want Git to show me the myriads of changes introduced after someone auto-formatted the code. Example usage: I hit git difftool --indent-before-diffing path/to/file and get the changes after both the original version of path/to/file and the modified version of path/to/file have been indented. 回答1: If you can find an application that does the indenting for you, you could use

Is there an alternative to hyper-indented code?

*爱你&永不变心* 提交于 2019-12-18 04:12:56
问题 I often run into code that has to perform lots of checks and ends up being indented at least five or six levels before really doing anything. I am wondering what alternatives exist. Below I've posted an example of what I'm talking about (which isn't actual production code, just something I came up with off the top of my head). public String myFunc(SomeClass input) { Object output = null; if(input != null) { SomeClass2 obj2 = input.getSomeClass2(); if(obj2 != null) { SomeClass3 obj3 = obj2