When using the directional keys to navigate, two cursor column positions should be used: an absolute position and a display position. The display position is always the same as the absolute position, unless the line does not have enough characters, in which case the display position is the last available position on that line.
Using up or down should move the cursor to the same position on the line immediately above or below respectively. If the line does not have enough characters to accomodate the cursor at that position, it should be displayed at the last available position instead, but the stored absolute position should not change. If the cursor is then moved again using up or down then the cursor should attempt to return to the stored absolute position, and fallback to the last available position as before. The up and down keys should never change the absolute position of the cursor, except when used on the first or last line respectively, when the absolute position is changed to the first or last available position on the line respectively.
Using left or right should move the cursor left or right one character, unless at the start or end of the line respectively, in which case the cursor should wrap around the the next available line. If the cursor's absolute position is different to its display position when left or right are used, the absolute position should then be updated to match the display position.
Environment
TypeDB version: 2.18.0
OS of TypeDB server: MacOS 12.6.1
Studio version: 23a501103bc8a2eb514967dc8c2ad36ddb5b5df9
OS of Studio: MacOS 12.6.1
Reproducible Steps
Create a file in the query editor with three lines of length 20, 10, and 30 characters respectively.
Scenario 1:
Place the cursor at the end of the first (20 char) line.
Use left to move the cursor one position to the left.
Use down to move the cursor to the second (10 char) line.
Use down to move the cursor to the third (30 char) line.
Scenario 2:
Place the cursor at the end of the first (20 char) line.
Use left to move the cursor one position to the left.
Use down to move the cursor to the second (10 char) line.
Use left to move the cursor one position to the left.
Use down to move the cursor to the third (30 char) line.
Description
When using the directional keys to navigate, two cursor column positions should be used: an absolute position and a display position. The display position is always the same as the absolute position, unless the line does not have enough characters, in which case the display position is the last available position on that line.
Using
up
ordown
should move the cursor to the same position on the line immediately above or below respectively. If the line does not have enough characters to accomodate the cursor at that position, it should be displayed at the last available position instead, but the stored absolute position should not change. If the cursor is then moved again usingup
ordown
then the cursor should attempt to return to the stored absolute position, and fallback to the last available position as before. Theup
anddown
keys should never change the absolute position of the cursor, except when used on the first or last line respectively, when the absolute position is changed to the first or last available position on the line respectively.Using
left
orright
should move the cursor left or right one character, unless at the start or end of the line respectively, in which case the cursor should wrap around the the next available line. If the cursor's absolute position is different to its display position whenleft
orright
are used, the absolute position should then be updated to match the display position.Environment
Reproducible Steps
Scenario 1:
left
to move the cursor one position to the left.down
to move the cursor to the second (10 char) line.down
to move the cursor to the third (30 char) line.Scenario 2:
left
to move the cursor one position to the left.down
to move the cursor to the second (10 char) line.left
to move the cursor one position to the left.down
to move the cursor to the third (30 char) line.Expected Output
Scenario 1:
Scenario 2:
Actual Output
Scenario 1:
Scenario 2: