Trailing space on empty lines
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 16
- Joined: Tue Feb 03, 2015 3:23 am
Trailing space on empty lines
In text mode (I haven't confirmed in Author mode), if I am indented and want to create a new blank line, the blank line has trailing spaces matching my indent level. I am able to turn this off by turning off Smart Indent, but then I have to manually indent after each carriage return. I have looked everywhere and can't seem to find a way (in Oxygen) to get rid of these trailing spaces. Format and Indent is not an option, because we are using Git, and need to avoid making unnecessary changes to the file. We can probably take care of this in a pre-commit hook, but I'm hoping there is some way to take care of it in Oxygen.
Let me include some code to demonstrate what I mean:
Desired Outcome:
Actual Outcome:
The difference won't be obvious unless you select each code block with your mouse, then you can see the extra spaces in the empty line. This is not a huge problem but it's bad form when using Git or SVN.
Let me include some code to demonstrate what I mean:
Desired Outcome:
Code: Select all
<p>Indented several tabstops.</p>
<p>And a new paragraph.</p>
Code: Select all
<p>Indented several tabstops.</p>
<p>And a new paragraph.</p>
-
- Posts: 2879
- Joined: Tue May 17, 2005 4:01 pm
Re: Trailing space on empty lines
Hi,
There is no option in Oxygen to automatically remove indents from empty lines.
I've logged a feature request for this.
Other than wasting a few bytes on the indents from the empty lines, I don't see a real consequence of this aspect.
If you feel the need to remove all spaces/indents from empty lines, you can use the Find/Replace dialog or Find/Replace in Files with:
Text to find: ^ +$
Replace with: (leave empty)
[x] Regular expression
Regards,
Adrian
There is no option in Oxygen to automatically remove indents from empty lines.
I've logged a feature request for this.
Other than wasting a few bytes on the indents from the empty lines, I don't see a real consequence of this aspect.
If you feel the need to remove all spaces/indents from empty lines, you can use the Find/Replace dialog or Find/Replace in Files with:
Text to find: ^ +$
Replace with: (leave empty)
[x] Regular expression
Regards,
Adrian
Adrian Buza
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
-
- Posts: 16
- Joined: Tue Feb 03, 2015 3:23 am
Re: Trailing space on empty lines
Thanks for your reply. In the meantime, I have added the following client-side pre-commit hook to my Git repo:
Code: Select all
# fix trailing whitespace
for file in `git diff-index --check --cached $against -- | grep '^[^+-]' | grep -o '^.*[0-9]\+:'` ; do
file_name=`echo ${file} | awk -F ':' {'print $1'}`
line_number=`echo ${file} | awk -F ':' {'print $2'}`
# I think the reason there are two sed commands here
# is that 'sed -i' is different on different systems.
# shoot me.
sed -i '' -E "${line_number}s/[ ]*$//" "${file_name}"
git add ${file_name}
echo "Re-wrote ${file_name} to trim whitespace."
done
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service