mirror of
https://github.com/Hopiu/micro.git
synced 2026-04-29 18:44:43 +00:00
Added removewhitespaces setting
This commit is contained in:
parent
95293457fb
commit
0558de12c6
2 changed files with 4 additions and 1 deletions
|
|
@ -463,7 +463,8 @@ func (v *View) InsertNewline(usePlugin bool) bool {
|
|||
v.Cursor.Right()
|
||||
}
|
||||
|
||||
if IsSpacesOrTabs(v.Buf.Line(v.Cursor.Y - 1)) {
|
||||
// Remove the whitespaces if removewhitespaces setting is on
|
||||
if IsSpacesOrTabs(v.Buf.Line(v.Cursor.Y - 1)) && v.Buf.Settings["removewhitespaces"].(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,6 +176,7 @@ func GetOption(name string) interface{} {
|
|||
func DefaultGlobalSettings() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"autoindent": true,
|
||||
"removewhitespaces": true,
|
||||
"autosave": false,
|
||||
"colorcolumn": float64(0),
|
||||
"colorscheme": "default",
|
||||
|
|
@ -208,6 +209,7 @@ func DefaultGlobalSettings() map[string]interface{} {
|
|||
func DefaultLocalSettings() map[string]interface{} {
|
||||
return map[string]interface{}{
|
||||
"autoindent": true,
|
||||
"removewhitespaces": true,
|
||||
"autosave": false,
|
||||
"colorcolumn": float64(0),
|
||||
"cursorline": true,
|
||||
|
|
|
|||
Loading…
Reference in a new issue