Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Editor removes my leading blanks #156

Closed
JohnScholes opened this issue Apr 27, 2017 · 2 comments
Closed

Editor removes my leading blanks #156

JohnScholes opened this issue Apr 27, 2017 · 2 comments

Comments

@JohnScholes
Copy link
Contributor

Describe the issue you are having

In an edit window, hitting enter in the left margin removes any leading blanks.

Did you connect to an already running interpreter or start the interpreter from RIDE?

Start

How do you reproduce the issue?

      )ed →cvec
in the edit window, type four blanks, followed by "hello"
move the cursor to the left margin and hit Return.
The "hello" moves down to the next line but my indentation has disappeared.

Notepad, ODE, textedit, ... preserve my blanks in this situation.
Happily, typing a backspace in the left margin, correctly joins any following text to the previous line and keeps my blanks.

Paste the contents of Help → About (Shift+F1)

IDE:
Version: 4.0.2789
Platform: MacIntel
Date: 2017-04-25 11:38:17 +0100
Git commit: 5700c3d
Preferences:{
"autocompletion":"0",
"kbdLocale":"en_US_Mac",
"lineNums":"0",
"pfkeys":"["","","","","","","","","","",")reset)save","",""]",
"squiggleTips":"0",
"valueTips":"0",
"zoom":"6"
}

Interpreter:
Version: 16.0.29826
Platform: Mac-64
Edition: Unicode/64
Date: Apr 27 2017 at 02:30:17

@ngn
Copy link
Contributor

ngn commented Apr 29, 2017

The fix for this one is a bit tricky.
cm.setOption('smartIndent',false) would still make the new line copy the previous line's indent, though not in a "smart" way. Technically, that works as documented.
The way I would work around it is make <ER> check the editor's mode, and if it's not APL, do cm.replaceSelection('\n','end') instead of cm.execCommand('newlineAndIndent').

It might also be worth chatting with Marijn and contributors about smartIndent's documented vs expected behaviour.

@e9gille
Copy link
Contributor

e9gille commented Jun 16, 2017

thanks @ngn , will put in your suggestion

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants