indentation

How to implement complicated auto-indentation in VScode

跟風遠走 提交于 2019-12-14 03:53:14
问题 I am working on a language extension for SAS for VScode. I previously worked on the SAS language extension for Atom (https://github.com/akanosora/language-sas) as well as Vim (part of the default Vim packages: https://github.com/vim/vim/blob/master/runtime/indent/sas.vim). I am not very satisfied with the auto-indentation implementation in Atom and it seems that VScode provides more or less the same mechanism for auto-indentation. The proper indentation for SAS code is quite tricky as the

How to change the indentation of all the lines except the first line in bulleted or non bulleted list?

♀尐吖头ヾ 提交于 2019-12-14 03:50:16
问题 So, I have simple bullet list like this: <ul> <li>Apple. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus venenatis elit turpis, vel facilisis risus pellentesque nec. Curabitur dapibus libero diam, egestas congue magna dictum ut. Fusce nec tortor ut erat ultrices fermentum. Proin dolor nibh, gravida eu mi sed, imperdiet venenatis est.</li> <li>Orange. Integer eget velit dolor. Aenean a metus at purus convallis porttitor. Etiam hendrerit leo eu elementum tempor. Sed at semper

How to write fancy-indented multi-line brace expansion in Bash?

你说的曾经没有我的故事 提交于 2019-12-14 03:48:49
问题 I'm dealing with a line such : mkdir -p "$DEST_ROOT_PATH/"{"$DEST_DIR1","$DEST_DIR2", ..., "$DEST_DIRN"} This line is quite long. I want to cut it so its width will fit into a 80 columns line. I tried to escape an end of line with a backslash, but space alignement breaks the expansion : $ echo "ha"{a,b,\ > c} ha{a,b, c} 回答1: You could use this disgusting hack. echo "ha"{a,b,\ > ` `c} It opens a subshell with nothing in it, but gets processed before the expansion so the expansion just sees an

Properly formatting JavaScript in JavaScript

冷暖自知 提交于 2019-12-14 02:31:54
问题 How can I automatically format JavaScript properly? As an example, this: (function(){(function(){alert('whatever')})()})() Should become: (function(){ (function(){ alert('whatever') })() })() 回答1: There is the jsbeautifier, you can find the source code at github. 回答2: Try http://jsbeautifier.org/ - it's the same one used by jsfiddle.net on their "Tidy Up" button where you can try it out. 来源: https://stackoverflow.com/questions/10366985/properly-formatting-javascript-in-javascript

Why does Python see a tab as 8 spaces?

好久不见. 提交于 2019-12-14 01:05:04
问题 Using a tab width of 4 spaces has emerged as the primary choice in programming. So why doesn't Python see a tab as 4 spaces instead of 8? Is there a (technical, historic, other) reason for this design decision? It feels like that could have saved developers from struggling with inconsistent indentation a lot. 回答1: Because the default tab size in Linux console is 8 spaces, and therefore most CLI text editors in Linux also default to 8 spaces. Most are also configurable, but it's been the

Getting consistent indentation in Eclipse and Emacs

爷,独闯天下 提交于 2019-12-13 20:32:43
问题 I am looking to start using emacs for php development. So far I have been using eclipse. I installed the Nxhtml mode in emacs (GNU Emacs23) for this. But I observe that when a file edited in emacs is opened in eclipse the indentation breaks. In eclipse I have the following settings, tab policy = spaces, indentation = 4 In emacs, I have this line in my .emacs file (setq-default c-basic-offset 4) Now lets say I create a file using emacs with the following contents <?php class HelloWorld {

Aligning bullets in JasperReports

此生再无相见时 提交于 2019-12-13 19:42:28
问题 The following post answers that bullets can have a hanging indent / be aligned by adding left-padding. Jasper Report HTML bullet hanging indent However, when I tried to do that, the whole line would move and so the bullets would no longer be padded So the text: - TEXT TEXT TEXT TEXT TEXT TEXT would become: - TEXT TEXT TEXT TEXT TEXT TEXT when what I want is: - TEXT TEXT TEXT TEXT TEXT TEXT How can I line up the second line of the bullets. Is there a hanging indent/first line indent that

Why is Python strict about indentation? [closed]

試著忘記壹切 提交于 2019-12-13 09:55:40
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 5 years ago . This question is coming from this Stack Overflow question. Why is Python is designed to use correct indentation either space or tab? In this way, is it purposefully to serve any benefit? 回答1: Indentation is essential in Python; it replaces curly braces, semi-colons, etc. in C-like

Python Indentation Error when there is no indent error

社会主义新天地 提交于 2019-12-13 09:38:17
问题 Is it me or the interpreter? I see no indentation error in my code but it kept telling me that there is an error! I use auto indentation so it should be ok. When ever there is an indentation error, I backspace then indent again and it seems to fix it because the indentation error is not on that line anymore but on the other line. Can someone please tell me what is wrong class LogicGate: def __init__(self,n): self.label = n self.output = None def getLabel(self): return self.label def getOutput

Auto Indent when a new line is made [closed]

一曲冷凌霜 提交于 2019-12-13 09:27:27
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 6 years ago . I'm working on a school project which is a HTML Editor. Right now, I've a problem on how to make an auto indentation whenever I make a new line. The spacing of indentation would be the same as the line above it. I hope my problem clear enough. private void richTextBox1_KeyDown(object sender, KeyEventArgs e) { if