Introduced view.column_markers. Default off.
This commit is contained in:
parent
eb08e4ec89
commit
c1c4960960
5 changed files with 51 additions and 33 deletions
|
@ -10,6 +10,7 @@ Diakonos Changelog
|
|||
- Added go_block_previous, go_block_next (Ctrl-PageUp, Ctrl-PageDown).
|
||||
- Added go_block_outer, go_block_inner (Alt-PageUp, Alt-PageDown).
|
||||
- Added find.show_context_after setting.
|
||||
- Added view.column_markers.
|
||||
- Several bugs fixed.
|
||||
|
||||
0.8.7
|
||||
|
|
|
@ -13,6 +13,10 @@ colour 41 15 233 # XML nodes; white on light black
|
|||
colour 42 45 233 # XML attributes; light blue on black
|
||||
colour 43 123 233 # XML namespaces; light blue on black
|
||||
|
||||
colour 44 white 52 # 80-char column marker white on very dark red
|
||||
|
||||
view.column_markers.margin.format 44
|
||||
|
||||
# Diakonos help files
|
||||
|
||||
lang.dhf.format.default white
|
||||
|
|
|
@ -4,6 +4,28 @@ logfile ~/.diakonos/diakonos.log
|
|||
|
||||
#session.default_session default-session
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Colour Definitions
|
||||
#
|
||||
# colour <integer greater than 7> <foreground colour> <background colour>
|
||||
#
|
||||
# For a list of colour names, see the list of format codes in the
|
||||
# Language Definitions section, below.
|
||||
#
|
||||
# With this colour command you can set a different background colour than the
|
||||
# terminal default.
|
||||
#
|
||||
# color is a synonym for colour.
|
||||
colour 8 white blue
|
||||
colour 9 white red
|
||||
colour 10 white magenta
|
||||
colour 11 yellow blue
|
||||
colour 12 white green
|
||||
colour 13 white brown
|
||||
colour 14 black cyan
|
||||
colour 15 yellow red
|
||||
|
||||
|
||||
# When the cursor is view.margin.y lines or less from the top or
|
||||
# bottom line, repeatedly scroll the screen view.jump.y lines until
|
||||
# the cursor is more than view.margin.y lines from the top and
|
||||
|
@ -26,6 +48,9 @@ view.line_numbers.width 4
|
|||
view.line_numbers.number_format "%3s "
|
||||
view.line_numbers.format white
|
||||
|
||||
#view.column_markers.margin.column 80
|
||||
view.column_markers.margin.format 9
|
||||
|
||||
# bol_behaviour: This specifies where the cursor should go when the
|
||||
# beginning-of-line key (the default is the Home key) is pressed.
|
||||
# zero: Always move to the left-most column of the line
|
||||
|
@ -413,27 +438,6 @@ key keycode319 operateOnLines
|
|||
#key ctrl+x ctrl+f;openFileAsk
|
||||
#key ctrl+x ctrl+s;saveFile
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Colour Definitions
|
||||
#
|
||||
# colour <integer greater than 7> <foreground colour> <background colour>
|
||||
#
|
||||
# For a list of colour names, see the list of format codes in the
|
||||
# Language Definitions section, below.
|
||||
#
|
||||
# With this colour command you can set a different background colour than the
|
||||
# terminal default.
|
||||
#
|
||||
# color is a synonym for colour.
|
||||
colour 8 white blue
|
||||
colour 9 white red
|
||||
colour 10 white magenta
|
||||
colour 11 yellow blue
|
||||
colour 12 white green
|
||||
colour 13 white brown
|
||||
colour 14 black cyan
|
||||
colour 15 yellow red
|
||||
|
||||
# ---------------------------------------------------------------------
|
||||
# Language Definitions
|
||||
# For syntax highlighting and indentation.
|
||||
|
|
|
@ -244,7 +244,9 @@ module Diakonos
|
|||
'find.return_on_abort', 'fuzzy_file_find', 'view.line_numbers',
|
||||
'find.show_context_after'
|
||||
@settings[ command ] = arg.to_b
|
||||
when "context.format", "context.separator.format", "status.format", 'view.line_numbers.format'
|
||||
when "context.format", "context.separator.format", "status.format", 'view.line_numbers.format',
|
||||
/view\.column_markers\.(.+?)\.format/
|
||||
debugLog "Setting #{command} to #{arg} (#{arg.toFormatting.inspect})"
|
||||
@settings[ command ] = arg.toFormatting
|
||||
when "logfile"
|
||||
@logfilename = arg.subHome
|
||||
|
@ -266,7 +268,7 @@ module Diakonos
|
|||
"view.margin.x", "view.margin.y", "view.scroll_amount", "view.lookback", 'grep.context',
|
||||
'view.line_numbers.width'
|
||||
@settings[ command ] = arg.to_i
|
||||
when "view.jump.x", "view.jump.y"
|
||||
when "view.jump.x", "view.jump.y", /view\.column_markers\.(.+?)\.column/
|
||||
value = arg.to_i
|
||||
if value < 1
|
||||
value = 1
|
||||
|
|
|
@ -392,6 +392,21 @@ module Diakonos
|
|||
end
|
||||
end
|
||||
|
||||
def paint_column_markers
|
||||
@settings.each do |setting,value|
|
||||
next if setting !~ /view\.column_markers\.(.+?)\.column/
|
||||
name = $1
|
||||
column = value
|
||||
next if column > Curses::cols - @left_column || column - @left_column < 0
|
||||
|
||||
( 0...@diakonos.main_window_height ).each do |row|
|
||||
@win_main.setpos( row, column - @left_column )
|
||||
@win_main.attrset @settings[ "view.column_markers.#{name}.format" ]
|
||||
@win_main.addstr @lines[ @top_line + row ][ column + @left_column ] || ' '
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
def printString( string, formatting = ( @token_formats[ @continued_format_class ] or @default_formatting ) )
|
||||
return if not @pen_down
|
||||
return if string.nil?
|
||||
|
@ -495,9 +510,6 @@ module Diakonos
|
|||
return if not @diakonos.do_display
|
||||
|
||||
Thread.new do
|
||||
#if $profiling
|
||||
#RubyProf.start
|
||||
#end
|
||||
|
||||
if @diakonos.display_mutex.try_lock
|
||||
begin
|
||||
|
@ -565,6 +577,8 @@ module Diakonos
|
|||
@win_main.addstr linestr
|
||||
end
|
||||
|
||||
paint_column_markers
|
||||
|
||||
if @win_line_numbers
|
||||
@win_line_numbers.refresh
|
||||
end
|
||||
|
@ -589,13 +603,6 @@ module Diakonos
|
|||
@diakonos.displayEnqueue( self )
|
||||
end
|
||||
|
||||
#if $profiling
|
||||
#result = RubyProf.stop
|
||||
#printer = RubyProf::GraphHtmlPrinter.new( result )
|
||||
#File.open( "#{ENV['HOME']}/svn/diakonos/profiling/diakonos-profile-#{Time.now.to_i}.html", 'w' ) do |f|
|
||||
#printer.print( f )
|
||||
#end
|
||||
#end
|
||||
end
|
||||
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue