Skip to content

Commit

Permalink
bugfixes: fix failure in open tab and remove obsoleted function
Browse files Browse the repository at this point in the history
- uri must not be decoded or fails to open tab
- URI.decode is obsolete. use CGI.unescape instead.
  • Loading branch information
susurri committed Jul 31, 2017
1 parent 1cfbd58 commit fc2c95b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions scripts/RestoreTabs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

require 'yaml'
require 'uri'
require 'cgi'

# nautilus module
module Nautilus
Expand Down Expand Up @@ -47,14 +48,15 @@ module Nautilus

def select_uri(uri)
return if uri.last.empty?
type(File.basename(URI.decode(URI.parse(uri.last.split("\n").first).path)),
type(File.basename(CGI.unescape(URI.parse(uri.last.split("\n")
.first).path)),
@config.config['select_uri_delay'])
key('Escape')
end

def open_uri(uri)
key('control+l')
type(URI.decode(uri.first))
type(uri.first + '/')
key('Return')
select_uri(uri)
end
Expand Down
6 changes: 3 additions & 3 deletions scripts/SaveTabs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
require 'yaml'
require 'English'
require 'shellwords'
require 'uri'
require 'cgi'

# Integer class
class Integer
Expand Down Expand Up @@ -160,9 +160,9 @@ def uris_to_s(uris)
str1 = if u[1].empty?
Shellwords.escape('-')
else
Shellwords.escape(URI.decode(u[1].chomp.tr("\n", ',')))
Shellwords.escape(CGI.unescape(u[1].chomp.tr("\n", ',')))
end
str += (Shellwords.escape(u[0]) + ' ' + str1 + ' ')
str += (Shellwords.escape(CGI.unescape(u[0])) + ' ' + str1 + ' ')
end
str
end
Expand Down

0 comments on commit fc2c95b

Please sign in to comment.