https://bugs.documentfoundation.org/show_bug.cgi?id=169477
Bug ID: 169477
Summary: Pressing `End` then `Home` on a line ending with a
hyphenated word moves the cursor to the beginning of
the next line
Product: LibreOffice
Version: 25.8.2.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Writer
Assignee: [email protected]
Reporter: [email protected]
Description:
Hyphenated word: a word split in two with a hyphen
When a line ends with a hyphenated word (i.e. the first part of the word is at
the end of the line and the next line begins with the second part of the word),
pressing the `End` key followed by the `Home` key will result in moving the
cursor to the beginning of the next line, instead of the beginning of the
current line.
Steps to Reproduce:
As a convenience, I provided a document with a line that ends with a hyphenated
word ("master-builder"). I'm referring to this document in the following steps.
1. Open the example document
2. Find the line "explorer of the truth, the master-"
3. Place the cursor on that line
4. Press the `End` key to move the cursor at the end of the line
5. Press the `Home` key
Actual Results:
The cursor is now at the beginning of the next line (i.e. "builder of human
happiness. No one")
Expected Results:
The cursor should be at the beginning of the current line (i.e. "explorer of
the truth, the master-"), like it's normally the case when pressing the `end`
and `home` keys consecutively
Reproducible: Always
User Profile Reset: Yes
Additional Info:
Notice how pressing `End` will result in the cursor being placed _after_ the
hyphen. To the contrary, when clicking with the mouse at the end of the line,
the cursor automatically gets placed at the beginning of the next line.
I'm not sure why this "click" behavior was implemented, but it seems to be the
root cause of the issue and is actually seems pretty buggy. For instance, I
found the other following issues which all seem to be related.
Bug #2
------
1. Select the 2 lines containing the hyphenated word (i.e. "explorer of the
truth, the master-" and "builder of human happiness. No one")
2. Now, click at the end of the line
Notice how this time the cursor is placed after the hyphen, instead of on the
next line, contrary to the mouse click behavior.
Bug #3
------
1. Put the cursor at the beginning of the line starting with the second part of
the hyphenated word (i.e. before "builder" on the line "builder of human
happiness. No one")
2. Select the whole line by pressing `Shift + End`
3. Press `Up`
Notice the cursor remains on the same line. Normally, the cursor goes on the
previous line, above the last character of the line that was selected.
And it keeps getting worse:
4. Press `Up` a bunch more times and notice _the cursor still doesn't move_
5. Press `Down` a couple of times and notice the cursor moving to the next
lines (okay, but we're not out of trouble yet)
6. Press `Up` a couple of times until coming back to the line that starts with
the second part of the hyphenated word
7. Then press `Up` again
Notice the cursor won't go up, no matter how many times you press `Up`.
At this point, the only ways to get unstuck are:
- Pressing `Right` then `Up`
- clicking with the mouse
- switching to another window (i.e. `Alt + Tab`) and then back to Writer
Bug #4
------
This one is pretty similar to the previous one, but it starts differently.
1. Put the cursor at the beginning of any line that's after the line that
starts with the second part of the hyphenated word (for instance, "that are
extremely painful. Nor")
2. Select the whole line by pressing `Shift + End`
3. Now press `Up` a bunch of times
4. Notice how the cursor is always where we expect it to be
5. Press `Up` until reaching the line that starts with the second part of the
hyphenated word
Notice how, this time, the cursor is placed at the beginning of the line (i.e.
before "builder"). From then on, when pressing `Up`, the cursor won't move and
we're basically in the same situation as bug #3.
Note
----
Though these issues might appear minor, I selected the `Normal` severity. The
reason is, I'm actually quite affected because I have a macro that relies
heavily on the following dispatch commands (c.f.
https://wiki.documentfoundation.org/Development/DispatchCommands#Writer):
- `GoToStartOfLine`
- `GoToEndOfLine`
- `EndOfLineSel`
The macro works perfectly fine except for lines ending with a hyphenated word
due to the erratic behaviors mentioned above.
The current workarounds I'm trying to implement are extremely hacky. And
considering how erratic these behaviors are, I'm worried I might not be able to
handle all the edge-cases and make my code bullet-proof.
As far as I'm concerned, I'd say this behavior when clicking at the end of the
line with the hyphenated word (i.e. to move the cursor at the beginning of the
next line) should simply be removed. Who knows, this might make all these
problems disappear? But that's just my two cents 😇
--
You are receiving this mail because:
You are the assignee for the bug.