Bug 168818 - F4 key does not cycle through individual references, when they have line breaks
Summary: F4 key does not cycle through individual references, when they have line breaks
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
7.5.9.2 release
Hardware: All All
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:26.8.0 target:26.2.0.0.beta2
Keywords:
Depends on:
Blocks:
 
Reported: 2025-10-12 01:02 UTC by Bene-Jázem
Modified: 2025-12-15 13:03 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments
print of screen (4.02 KB, image/png)
2025-10-12 01:02 UTC, Bene-Jázem
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Bene-Jázem 2025-10-12 01:02:57 UTC
Created attachment 203289 [details]
print of screen

I can't use F4 key to block cells reference in formula if I use line breaks on them. If I decide to maintain those LB, I have to insert $ symbol manually.
Comment 1 BogdanB 2025-10-12 10:47:26 UTC
I dont think formula is to be evaluated as constant, but individual cells.

"F4 alone: repeats the last command or action, if possible.
When a cell reference or range is selected in a formula, F4 cycles through all the various combinations of absolute and relative references."
Source https://support.microsoft.com/en-us/office/keyboard-shortcuts-in-excel-1798d9d5-842a-42b8-9c99-9b7213f0040f#bkmk_freqwin

If we select a range, like in your case "E4:E5" and if you press now f4 it will work.
So, exactly like Excel, in LibreOffice you need first to click on a reference, or to select a range, but it is not possible to apply to a formula, without selecting first the range.
Comment 2 Bene-Jázem 2025-10-13 20:00:15 UTC
Yes, I know Excel and Calc F4 key behaviors when editing formulas!

I am trying to say that "F4" key functionality stops working when you add line breaks on formulas.

Steps to reproduce:
1. Insert a formula with line breaks in it, like bellow:
  =SUM(
    A1+A2
  )
2. Select "A1" cell reference;
3. Press F4 and see that nothing happens.

PS: when there is no line breaks in the formula, putting cursor near cell reference (like "|A1", "A|1" or "A1|") will behave just the same as selecting the reference for F4 commands.
Comment 3 BogdanB 2025-10-14 05:02:16 UTC
Confirm with, using Shift+Enter for line break

Version: 25.8.2.2 (X86_64)
Build ID: d401f2107ccab8f924a8e2df40f573aab7605b6f
CPU threads: 16; OS: Linux 6.14; UI render: default; VCL: gtk3
Locale: ro-RO (en_US.UTF-8); UI: en-US
Calc: threaded
Comment 4 Mike Kaganski 2025-12-13 16:43:32 UTC
https://gerrit.libreoffice.org/c/core/+/195606
Comment 5 Commit Notification 2025-12-13 18:11:24 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/3d65a92eaba1b8a2aa90a6b5188c2631465c7f4d

tdf#168818: handle multiline formulas when toggling reference

It will be available in 26.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 6 nobu 2025-12-14 08:05:25 UTC
Works well.
Thank you.

[2025-12-14]
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 73561293382a2d0a8586f01a3395af890d3bd914
CPU threads: 2; OS: Linux 6.14; UI render: default; VCL: kf5 (cairo+xcb)
Locale: ja-JP (ja_JP.UTF-8); UI: ja-JP
Calc: threaded
Comment 7 Commit Notification 2025-12-15 09:55:23 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "libreoffice-26-2":

https://git.libreoffice.org/core/commit/92cbe0a8b8850faa495b8b3fbdcfd18380d5d4d9

tdf#168818: handle multiline formulas when toggling reference

It will be available in 26.2.0.0.beta2.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 8 nobu 2025-12-15 13:03:09 UTC
Works.

[2025-12-14]
Version: 26.8.0.0.alpha0+ (X86_64)
Build ID: 680(Build:0)
CPU threads: 4; OS: Windows 11 X86_64 (build 26100); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: CL threaded