aboutsummaryrefslogtreecommitdiffstats
path: root/src/files_map.adb
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2017-03-14 07:02:02 +0100
committerTristan Gingold <tgingold@free.fr>2017-03-14 07:02:02 +0100
commitf6f792afaab6f8a58a06dcbfd67f0c2bcb1dbe3a (patch)
tree1e716aca163b681dd053506d3293e8fb186e04b1 /src/files_map.adb
parenta9f8777e0fbb1b4ff5d8f6f7219a07782d755a4a (diff)
downloadghdl-f6f792afaab6f8a58a06dcbfd67f0c2bcb1dbe3a.tar.gz
ghdl-f6f792afaab6f8a58a06dcbfd67f0c2bcb1dbe3a.tar.bz2
ghdl-f6f792afaab6f8a58a06dcbfd67f0c2bcb1dbe3a.zip
Add Tab_Stop variable.
For #314
Diffstat (limited to 'src/files_map.adb')
-rw-r--r--src/files_map.adb5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/files_map.adb b/src/files_map.adb
index 3cb7e0594..66b3a1087 100644
--- a/src/files_map.adb
+++ b/src/files_map.adb
@@ -261,7 +261,8 @@ package body Files_Map is
-- Convert a physical column to a logical column.
-- A physical column is the offset in byte from the first byte of the line.
-- A logical column is the position of the character when displayed.
- -- A HT (tabulation) moves the cursor to the next position multiple of 8.
+ -- A HT (tabulation) moves the cursor to the next position multiple of the
+ -- tab stop.
-- The first character is at position 1 and at offset 0.
procedure Coord_To_Position (File : Source_File_Entry;
Line_Pos : Source_Ptr;
@@ -278,7 +279,7 @@ package body Files_Map is
else
for I in Line_Pos .. Line_Pos + Source_Ptr (Offset) - 1 loop
if Source_File.Source (I) = ASCII.HT then
- Res := Res + 8 - Res mod 8;
+ Res := Res + Tab_Stop - Res mod Tab_Stop;
else
Res := Res + 1;
end if;