mirror of
https://github.com/zyedidia/micro.git
synced 2026-02-05 22:50:21 +09:00
always scroll log to the cursor befor drawing and don't ask for save changes for help and log views
This commit is contained in:
@@ -193,7 +193,7 @@ func (v *View) ScrollDown(n int) {
|
||||
// If there are unsaved changes, the user will be asked if the view can be closed
|
||||
// causing them to lose the unsaved changes
|
||||
func (v *View) CanClose() bool {
|
||||
if v.Buf.IsModified {
|
||||
if v.Type == vtDefault && v.Buf.IsModified {
|
||||
char, canceled := messenger.LetterPrompt("Save changes to "+v.Buf.Name+" before closing? (y,n,esc) ", 'y', 'n')
|
||||
if !canceled {
|
||||
if char == 'y' {
|
||||
@@ -561,9 +561,15 @@ func (v *View) drawCell(x, y int, ch rune, combc []rune, style tcell.Style) {
|
||||
|
||||
// DisplayView renders the view to the screen
|
||||
func (v *View) DisplayView() {
|
||||
if v.Type == vtLog {
|
||||
// Log views should always follow the cursor...
|
||||
v.Relocate()
|
||||
}
|
||||
|
||||
if v.Buf.Settings["syntax"].(bool) {
|
||||
v.matches = Match(v)
|
||||
}
|
||||
|
||||
// The charNum we are currently displaying
|
||||
// starts at the start of the viewport
|
||||
charNum := Loc{0, v.Topline}
|
||||
|
||||
Reference in New Issue
Block a user