mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-16 22:07:09 +09:00
Changed removewhitespaces setting to keepautoindent
This commit is contained in:
@@ -463,8 +463,8 @@ func (v *View) InsertNewline(usePlugin bool) bool {
|
||||
v.Cursor.Right()
|
||||
}
|
||||
|
||||
// Remove the whitespaces if removewhitespaces setting is on
|
||||
if IsSpacesOrTabs(v.Buf.Line(v.Cursor.Y - 1)) && v.Buf.Settings["removewhitespaces"].(bool) {
|
||||
// Remove the whitespaces if keepautoindent setting is off
|
||||
if IsSpacesOrTabs(v.Buf.Line(v.Cursor.Y - 1)) && !v.Buf.Settings["keepautoindent"].(bool) {
|
||||
line := v.Buf.Line(v.Cursor.Y - 1)
|
||||
v.Buf.Remove(Loc{0, v.Cursor.Y - 1}, Loc{Count(line), v.Cursor.Y - 1})
|
||||
}
|
||||
|
||||
@@ -176,7 +176,7 @@ func GetOption(name string) interface{} {
|
||||
func DefaultGlobalSettings() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"autoindent": true,
|
||||
"removewhitespaces": true,
|
||||
"keepautoindent": false,
|
||||
"autosave": false,
|
||||
"colorcolumn": float64(0),
|
||||
"colorscheme": "default",
|
||||
@@ -209,7 +209,7 @@ func DefaultGlobalSettings() map[string]interface{} {
|
||||
func DefaultLocalSettings() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"autoindent": true,
|
||||
"removewhitespaces": true,
|
||||
"keepautoindent": false,
|
||||
"autosave": false,
|
||||
"colorcolumn": float64(0),
|
||||
"cursorline": true,
|
||||
|
||||
Reference in New Issue
Block a user