Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
bugzilla
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
etersoft
bugzilla
Commits
518c6ffa
Commit
518c6ffa
authored
Feb 27, 2005
by
mkanat%kerio.com
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug 282349: Comments are forced to being left-justified
Patch By Max Kanat-Alexander <mkanat@kerio.com> r=myk, r=gerv, a=justdave
parent
227cf9e1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
23 additions
and
25 deletions
+23
-25
Util.pm
Bugzilla/Util.pm
+21
-23
checksetup.pl
checksetup.pl
+2
-2
No files found.
Bugzilla/Util.pm
View file @
518c6ffa
...
...
@@ -43,28 +43,7 @@ use Bugzilla::Error;
use
Bugzilla::
Constants
;
use
Date::
Parse
;
use
Date::
Format
;
use
Text::
Autoformat
qw(autoformat break_wrap)
;
our
$autoformat_options
=
{
# Reformat all paragraphs, not just the first one.
all
=>
1
,
# Break only on spaces, and let long lines overflow.
break
=>
break_wrap
,
# Columns are COMMENT_COLS wide.
right
=>
COMMENT_COLS
,
# Don't reformat into perfect paragraphs, just wrap.
fill
=>
0
,
# Don't compress whitespace.
squeeze
=>
0
,
# Lines starting with ">" are not wrapped.
ignore
=>
qr/^>/
,
# Don't re-arrange numbered lists.
renumber
=>
0
,
# Keep short lines at the end of paragraphs as-is.
widow
=>
0
,
# Even if a paragraph looks centered, don't "auto-center" it.
autocentre
=>
0
,
};
use
Text::
Wrap
;
# This is from the perlsec page, slightly modifed to remove a warning
# From that page:
...
...
@@ -218,7 +197,26 @@ sub diff_strings {
sub
wrap_comment
($)
{
my
(
$comment
)
=
@_
;
return
autoformat
(
$comment
,
$autoformat_options
);
my
$wrappedcomment
=
""
;
# Use 'local', as recommended by Text::Wrap's perldoc.
local
$
Text::Wrap::
columns
=
COMMENT_COLS
;
# Make words that are longer than COMMENT_COLS not wrap.
local
$
Text::Wrap::
huge
=
'overflow'
;
# Don't mess with tabs.
local
$
Text::Wrap::
unexpand
=
0
;
# If the line starts with ">", don't wrap it. Otherwise, wrap.
foreach
my
$line
(
split
(
/\r\n|\r|\n/
,
$comment
))
{
if
(
$line
=~
qr/^>/
)
{
$wrappedcomment
.=
(
$line
.
"\n"
);
}
else
{
$wrappedcomment
.=
(
wrap
(
''
,
''
,
$line
)
.
"\n"
);
}
}
return
$wrappedcomment
;
}
sub
format_time
{
...
...
checksetup.pl
View file @
518c6ffa
...
...
@@ -313,8 +313,8 @@ my $modules = [
version
=>
'2.08'
},
{
name
=>
'Text::
Autoformat'
,
version
=>
'
0'
name
=>
'Text::
Wrap'
,
version
=>
'
2001.0131'
},
{
name
=>
'Mail::Mailer'
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment