mirror of
https://github.com/zyedidia/micro.git
synced 2026-03-30 14:47:16 +09:00
Slight cleanup
This commit is contained in:
@@ -40,7 +40,7 @@ func LoadInput() (string, []byte, error) {
|
|||||||
// Option 1
|
// Option 1
|
||||||
filename = os.Args[1]
|
filename = os.Args[1]
|
||||||
// Check that the file exists
|
// Check that the file exists
|
||||||
if _, err := os.Stat(filename); err == nil {
|
if _, e := os.Stat(filename); e == nil {
|
||||||
input, err = ioutil.ReadFile(filename)
|
input, err = ioutil.ReadFile(filename)
|
||||||
}
|
}
|
||||||
} else if !isatty.IsTerminal(os.Stdin.Fd()) {
|
} else if !isatty.IsTerminal(os.Stdin.Fd()) {
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ type View struct {
|
|||||||
// mouse release events
|
// mouse release events
|
||||||
mouseReleased bool
|
mouseReleased bool
|
||||||
|
|
||||||
// Syntax higlighting matches
|
// Syntax highlighting matches
|
||||||
matches SyntaxMatches
|
matches SyntaxMatches
|
||||||
// The matches from the last frame
|
// The matches from the last frame
|
||||||
lastMatches SyntaxMatches
|
lastMatches SyntaxMatches
|
||||||
@@ -460,7 +460,7 @@ func (v *View) HandleEvent(event tcell.Event) {
|
|||||||
v.mouseReleased = true
|
v.mouseReleased = true
|
||||||
}
|
}
|
||||||
// We don't want to relocate because otherwise the view will be relocated
|
// We don't want to relocate because otherwise the view will be relocated
|
||||||
// everytime the user moves the cursor
|
// every time the user moves the cursor
|
||||||
relocate = false
|
relocate = false
|
||||||
case tcell.WheelUp:
|
case tcell.WheelUp:
|
||||||
// Scroll up two lines
|
// Scroll up two lines
|
||||||
@@ -581,7 +581,6 @@ func (v *View) DisplayView() {
|
|||||||
screen.SetContent(x+tabchars, lineN, ' ', nil, selectStyle)
|
screen.SetContent(x+tabchars, lineN, ' ', nil, selectStyle)
|
||||||
}
|
}
|
||||||
|
|
||||||
x = 0
|
|
||||||
charNum++
|
charNum++
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user