aboutsummaryrefslogtreecommitdiffstats
path: root/libsolidity/interface
diff options
context:
space:
mode:
authorrivenhk <adamsau@hotmail.com.hk>2017-10-18 22:03:33 +0800
committerrivenhk <adamsau@hotmail.com.hk>2017-10-18 22:03:33 +0800
commitd53c44a066ad70a34a5c7d858e1cb6afa1cbda3a (patch)
tree4939c0eb1282090ffb49471925fcc1e445533dee /libsolidity/interface
parentb93a5980eddd6f61417fb9714110fda20c49698b (diff)
downloaddexon-solidity-d53c44a066ad70a34a5c7d858e1cb6afa1cbda3a.tar.gz
dexon-solidity-d53c44a066ad70a34a5c7d858e1cb6afa1cbda3a.tar.zst
dexon-solidity-d53c44a066ad70a34a5c7d858e1cb6afa1cbda3a.zip
updating formatting when source snippets is too long
Diffstat (limited to 'libsolidity/interface')
-rw-r--r--libsolidity/interface/SourceReferenceFormatter.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libsolidity/interface/SourceReferenceFormatter.cpp b/libsolidity/interface/SourceReferenceFormatter.cpp
index fc55d328..256adccc 100644
--- a/libsolidity/interface/SourceReferenceFormatter.cpp
+++ b/libsolidity/interface/SourceReferenceFormatter.cpp
@@ -53,14 +53,14 @@ void SourceReferenceFormatter::printSourceLocation(
int locationLength = endColumn - startColumn;
if (locationLength > 150)
{
- line = line.substr(0, startColumn) + line.substr(startColumn, 15) + "..." + line.substr(endColumn - 15, 15) + line.substr(endColumn, line.length() - endColumn);
- endColumn = startColumn + 33;
- locationLength = 33;
+ line = line.substr(0, startColumn + 75) + " ... " + line.substr(endColumn);
+ endColumn = startColumn + 80;
+ locationLength = 80;
}
if (line.length() > 150)
{
- line = "..." + line.substr(startColumn, locationLength) + "...";
- startColumn = 3;
+ line = " ... " + line.substr(startColumn, locationLength) + " ... ";
+ startColumn = 5;
endColumn = startColumn + locationLength;
}