3,268 questions
0
votes
0
answers
7
views
In node js docx library im trying to generate a word document. if i change PageMargin, the headers and footers also got affected by it.what to do?
enter image description here
sections: [{
properties: {
page: {
margin: { top: 0, // 1 inch
left: 1440, // 2 inches (shifts content right)
right: 1440, // 1 inch (affects ...
0
votes
1
answer
48
views
Strange indentation errors when running Python code with Shift+Enter in VS Studio Code
I recently installed VS Code and Python on a new computer and am running into unusual behavior when trying to run a simple try/except block. Take the following test line of code:
try:
1 / 0
except:...
0
votes
2
answers
78
views
VSCode adds unwanted extra spaces on enter
I am using VSCode since a couple years and have recently changed computers.
After installing VSCode, I came upon this issue:
lets say I have a list like this:
int_list = [
1, 2, 3, 4,
]
and now I ...
-3
votes
1
answer
97
views
switch statement and K&R indentation [closed]
If we follow K&R indentation, what is the standard way to indent a case with a block { ...} inside?
Example:
switch (a) {
case FOO:
f("hello");
break;
case BAR: ...
0
votes
0
answers
18
views
VS Code theme extension: editorIndentGuide.activeBackground not working for all indentation levels
my vue2 code
I've already set it up editorIndentGuide. ActiveBackground1~editorIndentGuide. ActiveBackground6 attribute,
Also set the editorIndentGuide. Background1~editorIndentGuide. Background6 ...
1
vote
0
answers
49
views
Making 4 spaces feel like 8-width tabs
I am used to using hard tabs, each of width 8, for all indentation. However, when I occasionally edit Python or Rust, the standard there is to use 4 spaces.
Is it possible to make all leading groups ...
2
votes
1
answer
37
views
Shifted indentation when wrapping text in TeX file with AstroNvim
I'm using AstroNvim to edit a .tex file. When I use gw to wrap some text, it introduces an indentation on every line after the first of the paragraph, as shown below:
I don't understand why this ...
1
vote
2
answers
78
views
Indentation of a nested function appears to require at least 5 spaces in haskell
I am trying to learn haskell through the advent of code (I know, it's late in the season), but I am encountering indentation issues I do not understand, despite checking what I believed to be the ...
0
votes
0
answers
83
views
Why do some syntaxes in Visual Studio get the wrong indentation?
Screenshot illustrating problem:
Code:
// Extract task details from the JSON output
var tasks = JsonConvert.DeserializeObject<List<Task>>(jsonOutput);
...
0
votes
2
answers
42
views
xmlstarlet fails to indent when formatting HTML?
So, I have this as input file, temp.html:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html><body>
&...
2
votes
0
answers
26
views
ESLint rule to enforce newline indentation style for multi-line assignments/expressions?
I'm trying to enforce this indentation style in TypeScript:
const response: Asana.Response<Asana.Tag[]> =
await tagsApi.getTagsForWorkspace(process.env.ASANA_WORKSPACE_GID!, opts);
...
-1
votes
1
answer
64
views
I set a file to indentation spaces 1, but it keeps opening with indentation space 2 [duplicate]
All files I create in Visual Studio Code version:
Version: 1.95.3 (user setup)
Commit: f1a4fb101478ce6ec82fe9627c43efbf9e98c813
Date: 2024-11-13T14:50:04.152Z
Electron: 32.2.1
ElectronBuildId: ...
1
vote
1
answer
169
views
Why is the VS Code terminal adding indents to blocks when I run them? [duplicate]
Fairly new to python and don't have much formal programming knowledge so hopefully one of you can help.
I previously used VSCode to run python scripts and it worked fine, but after some updates I'm ...
0
votes
0
answers
9
views
Is there a python function to make comparison?
NameError Traceback (most recent call last)
Cell In[38], line 16
14 def analyze_preparedness(df, variable):
15 urban_counts = df[[f'Urban_{level}' for level in ['...
0
votes
2
answers
50
views
XSL Indenting results
It has been awhile since I coded, and a friend has asked me for help. I can't seem to get my head around it. It's old code I'm trying to fix up.
Basically, I'm trying to make a table that indents for ...
0
votes
1
answer
34
views
Unindent and convert multiline string to single line [duplicate]
I have several multiline strings with indentation in my code, such as this (simplified example):
def foo():
cmd = '''ls
/usr/bin
/usr/sbin
/usr/...
4
votes
0
answers
358
views
How to fix the indentation problem for Javascript/Typescript on Neovim?
Problem Description
It's been a week since I started taking Neovim (lazyvim). Neovim has been used by me exclusively for Python and MERN Stack development. The indentation in Python is operating ...
0
votes
0
answers
49
views
Shortcuts for auto indentation not working
I want to use the command Reindent Selected Lines or Reindent Lines with a shortcut. I tried setting keybindings to each of them but when I press them in notebooks or scripts (using Python), nothing ...
0
votes
1
answer
637
views
Python code runs fine in VScode, but not in terminal - adds indentation [duplicate]
I just installed VSCode on my laptop. Every time I want to test a function in the terminal (shift+enter), it throws me an indentation error. I have tried everything in indentation settings, and have ...
0
votes
0
answers
30
views
Auto-indentation does not work properly with curly brackets when they are preceded by a pipe operator in RStudio
Indent the following lines of code with the key shortcuts
CTRL + A followed by CTRL + I
mtcars |>
identity()
{
t <- 1
}
# Do CTRL + A and CTRL + I
The results is not pretty :
mtcars |> ...
1
vote
0
answers
68
views
VSCode: Incorrect indentation after method chaining?
After I've concluded a block with method chaining, VSCode keeps the indentation until I format on save.
Example:
$orders = Order::paid()
->notShipped()
->get();
dd($orders); // <-...
5
votes
3
answers
472
views
Extra closing tag added when pasting HTML code in Visual Studio Code
I'm encountering an issue in Visual Studio Code when pasting HTML code, where an extra closing tag is automatically inserted, messing up the structure of my code. This happens with even the simplest ...
1
vote
1
answer
323
views
Jetbrains Rider: Prevent Indentation in file-scoped namespace
I am trying to make Rider not indent my c# code that is within a file-scoped namespace, because currently what Rider does, both when creating a new class and when reformatting existing code is the ...
0
votes
1
answer
269
views
A Script to Right Align and then Center the Text in Indesign Table
I'm having a trouble dealing with so many tables in indesign, there are approximately around 200 tables with the same characteristics. I'm wondering if anyone know any indesign script to right align ...
-2
votes
1
answer
78
views
Is Python a selectively interpreted language? Why does the following code not work?
As a program runs from top to bottom, why does the following code throw an error directly without executing the first line in the block?
if 5 > 2:
print("Two is less than Five!")
...
-1
votes
1
answer
44
views
How to set indentation for JTextArea?
I am trying to make my own IDE with Java. In the project, there is a JTextArea to write code but i want to handle indentation correctly.
private void handleEnterKey() {
Document doc = ...
0
votes
0
answers
31
views
Erratic Behavior in xTerm Terminal While Running Long Python Script with SSH Connections
Using xTerm terminal to run a long Python script. Randomly, while the script is running, the terminal behavior becomes erratic. New lines and indents get messed up.
For example, I see
**************...
-7
votes
1
answer
386
views
How to indent new line in IntelliJ after curly brackets
How can I get automatic indent on new line after pressing Enter after curly brackets in Java IntelliJ. Like when Entering inside Class or Method. If anyone can help. So is there any specific settings ...
0
votes
0
answers
95
views
Having trouble with mismatched input expecting end of line without line continuation in Tradingview
I'm having issues with a strategy I am trying to create. I've tried manually to ensure that 4 spaces are right as they should be starting at line bb_position. I have the code ready to be pasted and in ...
0
votes
0
answers
60
views
Python code elements to allow indention without flow control structures
When using Vim, I prefer to have one scheme for demarcating folds across all programming languages and even text files for meeting notes. It saves me from having to finagle different schemes. It has ...
0
votes
2
answers
235
views
How to enable Neovim's indentation for C files
Indentation works perfectly for Java and Python, but not C:
init.vim file:
set mouse=a
set encoding=utf-8
set number
set noswapfile
set scrolloff=7
set backspace=indent,eol,start
set clipboard+=...
0
votes
1
answer
60
views
display image in markdown with indent
I have something like this:
I want the image tied to the "higklmn" paragraph.
But the image can't show properly.
Please help
1
vote
1
answer
53
views
How to indent a specific line of an xml with Python?
I have 2 xml files.
The first one looks like this :
<?xml version="1.0" encoding="UTF-8"?>
<gmd:MD_Metadata xmlns:gmd="http://www.isotc211.org/2005/gmd" xmlns:...
1
vote
0
answers
42
views
Prevent "shift + some letters" re-indenting the current line in neovim
I encountered a strange and annoying thing about neovim (w/o any additional setup and plugins).
In the insert mode, when I type some (but not all) capital letters, neovim re-indent the current line.
...
0
votes
0
answers
87
views
Problem with Intelephense formatting HTML/PHP in VSC
A visual representation of the problem
The problem comes when trying to use php inside of HTML.
It wants to indent the entire php code to the right to where it thinks the php code should be.
The issue ...
-1
votes
1
answer
69
views
Error self.cap = cv2.VideoCapture(0) expected an indented block after 'if' statement
I want to build face recognition with python, i follow the tutorial at youtube and then this error appear when i try to run the app.
I exactly follow the tutorial right, but i don't know if i miss ...
1
vote
0
answers
27
views
How to avoid vscode html formatter to put open tags at the end of a line
I have an html file which I'm working on vscode. It is a big file that I got by converting a pdf file to html with an online converter.
The tags have inline css style, which results in a bunch of big ...
0
votes
0
answers
37
views
IndentationError even if VSCode insert it automatically
I'm a beginner with Python and I started using VSCode to study it.
Until yesterday I had no problems writing code that requires indentation, it all worked fine, but now I keep getting the indentation ...
0
votes
1
answer
53
views
Python: Trying to create a Parse & Sum Function to call later
As the title states, I'm trying to create (def) a function wherein I import re and then parse through a string (using Regular Expressions) to add the numbers up at the end in a list. I know the code ...
1
vote
1
answer
194
views
Indent headings in "markdown" cells in Jupyter Notebook after numbering
I am trying to number my headings in Jupyter Notebook. However, this looks quite ugly, as the size of the spaces is of course dependent on the font size.
I am looking for a way to make the text of ...
1
vote
0
answers
14
views
Eclipse auto format: C indentation setting of #define as function call parameter
when using the Eclipse auto format feature in C function calls the identation is messed up for me when I'm using a #define as function parameter. On the first hit of the auto format everything looks ...
2
votes
0
answers
35
views
Pre tag with style="white-space: pre-line" removes leading spaces as desired, but how can I prevent it from losing internal spacing?
I'm having an issue with the HTML pre tag. If I do a very simple test it preserves spacing the way that I want it to. For instance, notice that there are two spaces in a row in certain parts of the ...
0
votes
1
answer
78
views
Disable javascript auto semicolon
Is there a way to to prevent javascript from auto assuming optional semicolons (in the browser, not node).
I tried to use the strict mode, but that did not help.
Background: I write my code in more or ...
0
votes
1
answer
144
views
Can I set VS Code to use tabs for indentation and spaces for leading alignment?
Is there a way to get VS Code to use tabs for indentation and spaces for alignment)? As an example:
function foo(){
\t--array.map(a => a[0])
\t-- .filter(a => a);
}
In this case, \t-- ...
1
vote
1
answer
45
views
De-indenting the label of a <select> with with indented options
I have a tree, implemented as a nested dictionary, and I need to come up with a way for the user to choose two nodes, one of which must be a descendant of the other.
A simple drop-down would probably ...
0
votes
1
answer
41
views
How to preserve json file format when writing a file
I have two json files data1.json and data2.json. I compare two files and output the differences found in data1.json to a new file data3.json. I would like to preserve the format of data3.json as data1....
0
votes
0
answers
43
views
Why does Visual Studio Code continue to indent after a }?
i got a strange issue,
i frequently have to used the auto indent on VS but when i'm in php, it seems to act strange when i'm coding classes, (thats really annoying cause im at 8 indent now at the ...
3
votes
4
answers
703
views
Convert entire (Python) file from 2-space indent to 4-space indent
I regularly work with Python files that are provided to me as templates, which use an indentation of 2. However, I personally prefer working with an indentation width of 4, which is what I've set in ...
0
votes
0
answers
38
views
Can I set different fonts for different languages in IntelliJ Idea?
I prefer proportional fonts, but these are not viable for code styles relying on alignment with spaces like in Clojure. So I would like to keep my current font for most languages in IntelliJ Idea and ...
0
votes
0
answers
27
views
GTsummary PIndent Third Time Issue
I need help indenting a third time using gtsummary. Ideally, 'Documented Virus' would be indented underneath 'Bronchiolitis/pneumonitis', and everything underneath that is already indented would be ...