Removed open confirmation for empty files, or no files.
This commit is contained in:
parent
665872af62
commit
e8570dc705
2 changed files with 23 additions and 14 deletions
29
diakonos
29
diakonos
|
@ -2491,28 +2491,31 @@ class Diakonos
|
|||
end
|
||||
|
||||
def start
|
||||
num_opened = 0
|
||||
if @files.length == 0 and @read_only_files.length == 0
|
||||
openFile
|
||||
num_opened += 1 if openFile
|
||||
else
|
||||
@files.each do |file|
|
||||
openFile file
|
||||
num_opened += 1 if openFile file
|
||||
end
|
||||
@read_only_files.each do |file|
|
||||
openFile( file, Buffer::READ_ONLY )
|
||||
num_opened += 1 if openFile( file, Buffer::READ_ONLY )
|
||||
end
|
||||
end
|
||||
|
||||
switchToBufferNumber 1
|
||||
if num_opened > 0
|
||||
switchToBufferNumber 1
|
||||
|
||||
updateStatusLine
|
||||
updateContextLine
|
||||
@win_main.setpos( @y, @x )
|
||||
# Main keyboard loop.
|
||||
while not @quitting
|
||||
getKeystroke
|
||||
@win_main.refresh
|
||||
updateStatusLine
|
||||
updateContextLine
|
||||
@win_main.setpos( @y, @x )
|
||||
# Main keyboard loop.
|
||||
while not @quitting
|
||||
getKeystroke
|
||||
@win_main.refresh
|
||||
end
|
||||
@debug.close
|
||||
end
|
||||
@debug.close
|
||||
end
|
||||
|
||||
# context is an array of characters (bytes) which are keystrokes previously
|
||||
|
@ -3412,7 +3415,7 @@ class Diakonos
|
|||
# Does the "file" utility exist?
|
||||
if FileTest.exist?( "/usr/bin/file" ) and filename != nil and FileTest.exist?( filename )
|
||||
file_type = `/usr/bin/file -L #{filename}`
|
||||
if file_type !~ /text/
|
||||
if file_type !~ /text/ and file_type !~ /empty$/
|
||||
choice = getChoice(
|
||||
"#{filename} doesn't appear readable. Open anyway?",
|
||||
[ CHOICE_YES, CHOICE_NO ],
|
||||
|
|
|
@ -560,6 +560,12 @@ lang.bash.indent.roundup true
|
|||
lang.bash.tabsize 4
|
||||
lang.bash.tokens.comments (^\s*#.*)
|
||||
lang.bash.tokens.comments.format 8 bold
|
||||
lang.bash.tokens.doublequoted_strings (\".*?[^\\]\")
|
||||
lang.bash.tokens.doublequoted_strings.format green bold
|
||||
lang.bash.indent.indenters (\{)
|
||||
lang.bash.indent.unindenters (\})
|
||||
lang.bash.indent.preventers (\".+?[^\\]\")|('.+?[^\\]')|(\/\/.*)
|
||||
lang.bash.indent.ignore ^(.+:|\s*?)$
|
||||
|
||||
# Tcl
|
||||
|
||||
|
|
Loading…
Reference in a new issue