Skip to content

Commit

Permalink
use script-local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
sjbach committed Jun 25, 2012
1 parent 2cf6e2c commit 20ecaf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions plugin/lusty-explorer.vim
Original file line number Diff line number Diff line change
Expand Up @@ -1821,7 +1821,7 @@ class Display
end

def create(prefix)
VIM::command("let g:winstate = winrestcmd()")
VIM::command("let s:winstate = winrestcmd()")

# Make a window for the display and move there.
# Start at size 1 to mitigate flashing effect when
Expand Down Expand Up @@ -2003,7 +2003,7 @@ class Display
def self.max_height
VIM::command("resize") # the resize command defaults to the max height
highest_allowable = $curwin.height
VIM::command("exe g:winstate") # restore the window state
VIM::command("exe s:winstate") # restore the window state
return highest_allowable
end

Expand Down Expand Up @@ -2073,7 +2073,7 @@ class Display
# Grow/shrink the window as needed
old_height = $curwin.height
$curwin.height = rows.length + (truncated ? 1 : 0)
VIM::command("exe g:winstate") if $curwin.height < old_height
VIM::command("exe s:winstate") if $curwin.height < old_height

# Print the rows.
rows.each_index do |i|
Expand Down
6 changes: 3 additions & 3 deletions src/lusty/display.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def initialize(title)
end

def create(prefix)
VIM::command("let g:winstate = winrestcmd()")
VIM::command("let s:winstate = winrestcmd()")

# Make a window for the display and move there.
# Start at size 1 to mitigate flashing effect when
Expand Down Expand Up @@ -222,7 +222,7 @@ def close
def self.max_height
VIM::command("resize") # the resize command defaults to the max height
highest_allowable = $curwin.height
VIM::command("exe g:winstate") # restore the window state
VIM::command("exe s:winstate") # restore the window state
return highest_allowable
end

Expand Down Expand Up @@ -292,7 +292,7 @@ def print_rows(rows, truncated)
# Grow/shrink the window as needed
old_height = $curwin.height
$curwin.height = rows.length + (truncated ? 1 : 0)
VIM::command("exe g:winstate") if $curwin.height < old_height
VIM::command("exe s:winstate") if $curwin.height < old_height

# Print the rows.
rows.each_index do |i|
Expand Down

0 comments on commit 20ecaf5

Please sign in to comment.