Latex-workshop: 'Enter' key erroneously retains selected text & doesn't auto-indent

Created on 15 Aug 2018  路  6Comments  路  Source: James-Yu/LaTeX-Workshop

Description

'Enter' retains currently selected text, and only adds a newline at the end of the selection.

Log messages

Not relevant.

How to reproduce

  1. write a line of text
  2. select a portion of the line
  3. press 'Enter'

Expected behavior

The selected text is erased, a new line is added, and the remaining non-selected text on the line is moved on the next line. Basically normal standardized 'Enter' key behaviour.

Actual behavior

The selected text is not erased.

Additional Information

Probably connected to #739 and #740. I can't be sure, but I think auto-tab on newline is also broken. I believe it's connected to this changelog entry:

  • (#719) Supersed 'Enter' to automatically add \item while itemizing.

I'd rather not have the automatic \item insertion, and retain all the normal 'Enter' feautures of the editor. Maybe add a setting to choose the key's behaviour?

All 6 comments

More information regarding the auto-tab issue:

How to reproduce

  1. Open up some environment (e.g. \begin{figure})
  2. Indent the first line in said environment
  3. Place the cursor at the end of the first line and press Enter

Expected behavior

The position of the cursor is set to the beginning of the next line with the same indentation as the first line

Actual behavior

The position of the cursor is set to the beginning of the next line without the indentation of the first line

Additional Information

Expected outcome:

\begin{figure}
    \centering
    | <- cursor position
\end{figure}

Actual outcome:

\begin{figure}
    \centering
| <- cursor position
\end{figure}

Edit: Yup, misread your issue. The new title works for me.

@denniseffing Are you not getting my other issue with the selected text not being removed?

@jlelong Seems we have a lot of problems with the ENTER hack. Any idea?

@James-Yu, I am currently on vacation without my laptop. I will try to have a look next week.
Meanwhile, the best is perhaps to revert my commit. Sorry

No need to feel sorry @jlelong . I will release a new version without the ENTER hack soon so no worries. Have a nice trip!

Thanks guys!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jabooth picture jabooth  路  3Comments

BjoernDaase picture BjoernDaase  路  3Comments

LordScree picture LordScree  路  5Comments

tillahoffmann picture tillahoffmann  路  6Comments

drdebmath picture drdebmath  路  4Comments