Permalink
Browse files

use script-local variable

  • Loading branch information...
1 parent 2cf6e2c commit 20ecaf519ae3ef60e723b6a55064e956b6214ce2 @sjbach committed Jun 25, 2012
Showing with 6 additions and 6 deletions.
  1. +3 −3 plugin/lusty-explorer.vim
  2. +3 −3 src/lusty/display.rb
@@ -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
@@ -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
@@ -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|
View
@@ -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
@@ -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
@@ -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|

0 comments on commit 20ecaf5

Please sign in to comment.