Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
A
annotate
Project
Overview
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
open-source
annotate
Commits
1df2153f
Commit
1df2153f
authored
Nov 09, 2019
by
Alexander Belozerov
Committed by
Cuong Tran
Nov 09, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[Fix #675] Correct indentation for double-byte characters (#676)
parent
a8162558
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
1 deletion
+7
-1
annotate_models.rb
lib/annotate/annotate_models.rb
+1
-1
annotate_models_spec.rb
spec/lib/annotate/annotate_models_spec.rb
+6
-0
No files found.
lib/annotate/annotate_models.rb
View file @
1df2153f
...
@@ -920,7 +920,7 @@ module AnnotateModels
...
@@ -920,7 +920,7 @@ module AnnotateModels
end
end
def
width
(
string
)
def
width
(
string
)
string
.
chars
.
inject
(
0
)
{
|
acc
,
elem
|
acc
+
(
elem
.
bytesize
==
1
?
1
:
2
)
}
string
.
chars
.
inject
(
0
)
{
|
acc
,
elem
|
acc
+
(
elem
.
bytesize
==
3
?
2
:
1
)
}
end
end
def
mb_chars_ljust
(
string
,
length
)
def
mb_chars_ljust
(
string
,
length
)
...
...
spec/lib/annotate/annotate_models_spec.rb
View file @
1df2153f
...
@@ -1006,6 +1006,9 @@ EOS
...
@@ -1006,6 +1006,9 @@ EOS
[
:active
,
:boolean
,
{
limit:
1
,
comment:
'ACTIVE'
}],
[
:active
,
:boolean
,
{
limit:
1
,
comment:
'ACTIVE'
}],
[
:name
,
:string
,
{
limit:
50
,
comment:
'NAME'
}],
[
:name
,
:string
,
{
limit:
50
,
comment:
'NAME'
}],
[
:notes
,
:text
,
{
limit:
55
,
comment:
'NOTES'
}],
[
:notes
,
:text
,
{
limit:
55
,
comment:
'NOTES'
}],
[
:cyrillic
,
:text
,
{
limit:
30
,
comment:
'Кириллица'
}],
[
:japanese
,
:text
,
{
limit:
60
,
comment:
'熊本大学 イタリア 宝島'
}],
[
:arabic
,
:text
,
{
limit:
20
,
comment:
'لغة'
}],
[
:no_comment
,
:text
,
{
limit:
20
,
comment:
nil
}],
[
:no_comment
,
:text
,
{
limit:
20
,
comment:
nil
}],
[
:location
,
:geometry_collection
,
{
limit:
nil
,
comment:
nil
}]
[
:location
,
:geometry_collection
,
{
limit:
nil
,
comment:
nil
}]
]
]
...
@@ -1021,6 +1024,9 @@ EOS
...
@@ -1021,6 +1024,9 @@ EOS
# active(ACTIVE) :boolean not null
# active(ACTIVE) :boolean not null
# name(NAME) :string(50) not null
# name(NAME) :string(50) not null
# notes(NOTES) :text(55) not null
# notes(NOTES) :text(55) not null
# cyrillic(Кириллица) :text(30) not null
# japanese(熊本大学 イタリア 宝島) :text(60) not null
# arabic(لغة) :text(20) not null
# no_comment :text(20) not null
# no_comment :text(20) not null
# location :geometry_collect not null
# location :geometry_collect not null
#
#
...
...
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