Bug 63994 - Calc Multiline Input (input line at top of document): Allow creating new line with Shift-Return
Summary: Calc Multiline Input (input line at top of document): Allow creating new line...
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Calc (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: All All
: medium enhancement
Assignee: Samuel Mehrbrodt (allotropia)
URL:
Whiteboard: target:5.2.0,
Keywords: needsUXEval
: 99865 (view as bug list)
Depends on:
Blocks:
 
Reported: 2013-04-27 12:14 UTC by Samuel Mehrbrodt (allotropia)
Modified: 2016-08-05 22:12 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Samuel Mehrbrodt (allotropia) 2013-04-27 12:14:08 UTC
When using the Multi-Line control in Calc, and the Cursor was in that control, I was not able to create a new line either with 'Return' nor with Shift+Return.
I had to use Ctrl+Return.

I would suggest the following behavior:
-When the Cursor is in a cell, allow creating a new line with Shift+Return
-When the Cursor is in the Edit Control, allow creating a new line with Shift+Return AND Return
Comment 1 Jorendc 2013-04-28 21:01:25 UTC
I can "reproduce" this behavior using Mac OSX 10.8.3 (using cmd+return instead of ctrl+return (off course :p)).

Therefore I mark this as NEW.

@Samuel: I think you are more experienced in this matter: shouldn't this be an enhancement request instead of a bug? (just a question :) )

Kind regards,
Joren
Comment 2 Samuel Mehrbrodt (allotropia) 2013-04-29 20:58:05 UTC
(In reply to comment #1)
You are right, marking this as enhancement.
Comment 3 Samuel Mehrbrodt (allotropia) 2016-05-06 10:03:59 UTC
Probably it's not a good idea to have Return creating a new line, as this is expected to end editing and move to the next cell.

But Shift-Return should definitely create a new line in there (as it does when the cursor is in the cell).
Comment 4 Eike Rathke 2016-05-11 12:46:07 UTC
Just for completeness, Shift+Enter when editing a cell after closing the input moves the cell cursor into the opposite direction of what is defined for Enter in the options, so that should not be touched if not editing in the edit control.
Comment 5 Commit Notification 2016-05-12 11:55:38 UTC
Samuel Mehrbrodt committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=8bcacdc832058a7728ab5e8260a2266033033a07

tdf#63994 Calc Multiline Input: Create new line with Shift-Return

It will be available in 5.2.0.

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

Affected users are encouraged to test the fix and report feedback.
Comment 6 Luke 2016-05-12 16:17:25 UTC
Could we change this to alt-enter? This is historically what spreadsheets have always used. See Gnumeric, Excel, and WPS Sheets as examples of this.
Comment 7 Samuel Mehrbrodt (allotropia) 2016-05-13 05:48:50 UTC
(In reply to Luke from comment #6)
> Could we change this to alt-enter? This is historically what spreadsheets
> have always used. See Gnumeric, Excel, and WPS Sheets as examples of this.

Maybe we can add that as a third alternative? I saw that in Excel 2013 you can create a new line *only* with Alt-Enter whether you are in a cell or in the input line.

I still think that in the input line we should allow new lines with Shift-Enter.
Comment 8 Luke 2016-05-15 06:09:40 UTC
I've been using spreadsheets for 15+ years and as long as I can remember, 
enter = move down 1 cell
shift+enter = move up 1 cell 
alt+enter = new line

Moving up/down this way is part of my muscle memory. It doesn't matter if the cursor is on a cell or in the input line. Making shortcuts behave differently for the input line is a bad idea. We should follow the standard that all spreadsheets use. Look at WPS sheets for example:
 
http://www.ksosoft.com/spreadsheets/418-keyboard-shortcut-key-spreadsheet-2013.html
Comment 9 Óvári 2016-05-16 05:38:17 UTC
A reason that comes to mind for implementing Shift+Enter is that Calc will be consistent with Writer; however, drawbacks that come to mind are:


A. Reduces efficiency

Calc may require additional keystrokes to perform some tasks now.

For example, does the following implementation mean that to move from cell C3 to cell C2 requires the following keys:
  1. Press Enter
  2. Press Shift+Enter
  3. Press Shift+Enter
whereas before it was just:
  1. Press Shift+Enter
?


B. Training end users (exceptions to the rule)

Is having the behaviour of Shift+Enter depend on which mode Calc is in considered similar (in programming) to having a global and a local variable with the same name? Would it be better to have alt(ernative) names for the global and local variables?

Training people that key combinations do different things depending on the scenario for the same application.

People may not read the entire help file entry to find the exception to the rule and submit a bug; or worse, just complain to others around them that the program does not work.

Perhaps their may be time-tested reasons why Ctrl+Enter and/or Alt+Enter is preferable to Shift+Enter as:
Microsoft Excel            → Alt + Enter   (version 2010)
Kingsoft WPS Spreadsheets  → Alt + Enter   (from comment 8)
Gnumeric                   → Alt + Enter   (from comment 6)
Google Sheets              → Ctrl + Enter  (tested 16 May 2016)


As I have not coded any of the program, all the credit and decision making goes to the programmers Samuel Mehrbrodt and Eike Rathke. Thank you for your development of this wonderful program.
Comment 10 Luke 2016-05-17 01:16:37 UTC
Samuel,
You're overriding a standard spreadsheet function to follow word processing standard in the middle the 5.2 feature freeze. Could you please consider reverting this commit and waiting until the 5.3 branch? This change has the potential to make a lot of spreadsheet users unhappy.
Comment 11 Samuel Mehrbrodt (allotropia) 2016-05-17 05:55:24 UTC
(In reply to Luke from comment #10)
> Samuel,
> You're overriding a standard spreadsheet function to follow word processing
> standard in the middle the 5.2 feature freeze. Could you please consider
> reverting this commit and waiting until the 5.3 branch? This change has the
> potential to make a lot of spreadsheet users unhappy.

Should we change it to Alt-Return instead?
Comment 12 Heiko Tietze 2016-05-17 07:00:16 UTC
While voting pro Alt + return, there might be a difference between Windows, Linux and MacOS whether Alt or Ctrl is the usual modifier key for line feeds.

As supportive function we could add a context menu entry "Line feed <Alt+Enter>", which is disabled when not in cell edit mode, of course. But since the menu in Calc is heavily depending on the context (Insert, Delete, Clear, Format, Paste special/only, Field, Character) it needs to be considered that our context menus are not "helpful" by default.
Comment 13 Samuel Mehrbrodt (allotropia) 2016-05-17 11:56:14 UTC
*** Bug 99865 has been marked as a duplicate of this bug. ***
Comment 14 Óvári 2016-05-17 12:37:15 UTC
LibreOffice 5.1 on PC & Linux:
New line         Ctrl+Enter
Open hyperlink   Ctrl+Click

Google Sheets
https://support.google.com/docs/answer/181110?hl=en
PC          Open hyperlink   Alt+Enter
Mac         Open hyperlink   Option+Enter
Chrome OS   Open hyperlink   Alt+Enter
Ctrl+Enter seems to be a better fit than Alt+Enter to open a hyperlink as Ctrl+Click with Firefox opens a link in a new tab (window). Similar, Ctrl+Click in Calc opens the hyperlink in a new web browser window. Alt+Click does nothing for a hyperlink in Firefox.


Suggested LibreOffice default shortcuts:

Open hyperlink   Ctrl+Click
   Stays the same
   Ctrl for both mouse(Click) and keyboard(Enter)

Open hyperlink   Ctrl+Enter
   Change current behaviour from new line
   Accessible without a mouse
   Ctrl for both mouse(Click) and keyboard(Enter)

New line         Alt+Enter
   Common spreadsheet defaults, see comment 9
   Whether disabled for certain modes could be discussed further


Default keyboard only shortcuts are able to be redefined in LibreOffice:
  Tools → Customise… → Keyboard
Not sure how to change the default shortcuts for keyboard&mouse, eg. Ctrl+Click.


When hovering above a hyperlink in Calc, the text shows:
  Ctrl-Click to follow link:…
Suggested to change ‘-’ to ‘+’, i.e.:
  Ctrl+Click to follow link:…


Thank you
Comment 15 Eike Rathke 2016-05-17 13:50:47 UTC
A word on Alt+Enter: that enters the value into all selected cells, so using it for newline isn't possible.
Comment 16 Eike Rathke 2016-05-17 13:56:38 UTC
(In reply to Luke from comment #10)
> You're overriding a standard spreadsheet function to follow word processing
> standard in the middle the 5.2 feature freeze. Could you please consider
> reverting this commit and waiting until the 5.3 branch? This change has the
> potential to make a lot of spreadsheet users unhappy.

The new behavior overrides Shift+Enter only when in the input line edit control, not when editing within a cell. Could you elaborate on which lot of users uses the input line to edit content instead of editing within the cell and then expects Shift+Enter to move into the opposite direction of Enter?
Comment 17 jani 2016-05-18 05:25:56 UTC
Changed status to "ASSIGNED" to reflect that Samuel is working on this issue
Comment 18 Óvári 2016-06-12 12:27:24 UTC
(In reply to Eike Rathke from comment #15)
> A word on Alt+Enter: that enters the value into all selected cells, so using
> it for newline isn't possible.

There are also two additional ways, perhaps even more, using keyboard shortcuts, to enter values into all selected cells:
1. Ctrl+V
2. Shift+Ins

Perhaps Alt+Enter could be redefined for newline?

Thank you
Comment 19 Samuel Mehrbrodt (allotropia) 2016-06-23 08:52:39 UTC
Closing now, please create a new bug and cc me if any issues arise.
Comment 20 Luke 2016-06-23 16:54:18 UTC
Samuel,
Issues did arise and they were closed as dupes of this report. Why was 
https://gerrit.libreoffice.org/#/c/25060/
abandoned?
Comment 21 Samuel Mehrbrodt (allotropia) 2016-06-29 08:04:27 UTC
(In reply to Luke from comment #20)
> Samuel,
> Issues did arise and they were closed as dupes of this report. Why was 
> https://gerrit.libreoffice.org/#/c/25060/
> abandoned?

See comment from Eike in Gerrit: 
> Alt+Enter conflicts with "input into all selected cells", see https://bugs.documentfoundation.org/show_bug.cgi?id=63994#c15