Skip to content

Commit 0781bc2

Browse files
committed
Merge branch 'fix-file-paths' into dev
Conflicts: README.md plugin/python/vdebug/event.py plugin/python/vdebug/runner.py plugin/python/vdebug/ui/vimui.py plugin/python/vdebug/util.py plugin/vdebug.vim
2 parents 28b2182 + e6d8dad commit 0781bc2

File tree

5 files changed

+24
-5
lines changed

5 files changed

+24
-5
lines changed

plugin/python/vdebug/event.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def execute(self,runner):
141141
filename_pos = line.find(" @ ") + 3
142142
file_and_line = line[filename_pos:]
143143
line_pos = file_and_line.rfind(":")
144-
file = vdebug.util.FilePath(file_and_line[:line_pos])
144+
file = vdebug.util.LocalFilePath(file_and_line[:line_pos])
145145
lineno = file_and_line[line_pos+1:]
146146
runner.ui.sourcewin.set_file(file)
147147
runner.ui.sourcewin.set_line(lineno)

plugin/python/vdebug/runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ def refresh(self,status):
113113
stack_res = self.update_stack()
114114
stack = stack_res.get_stack()
115115

116-
self.cur_file = vdebug.util.FilePath(stack[0].get('filename'))
116+
self.cur_file = vdebug.util.RemoteFilePath(stack[0].get('filename'))
117117
self.cur_lineno = stack[0].get('lineno')
118118

119119
vdebug.log.Log("Moving to current position in source window")

plugin/python/vdebug/ui/vimui.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ def set_listener_details(self,addr,port,idekey):
100100
self.statuswin.insert(details,1,True)
101101

102102
def get_current_file(self):
103-
return vdebug.util.FilePath(vim.current.buffer.name)
103+
return vdebug.util.LocalFilePath(vim.current.buffer.name)
104104

105105
def get_current_row(self):
106106
return vim.current.window.cursor[0]
@@ -238,7 +238,7 @@ def set_line(self,lineno):
238238

239239
def get_file(self):
240240
self.focus()
241-
self.file = vdebug.util.FilePath(vim.eval("expand('%:p')"))
241+
self.file = vdebug.util.LocalFilePath(vim.eval("expand('%:p')"))
242242
return self.file
243243

244244
def clear_signs(self):
@@ -482,7 +482,7 @@ def render(self):
482482
string = ""
483483
for s in stack:
484484
where = s.get('where') if s.get('where') else 'main'
485-
file = vdebug.util.FilePath(s.get('filename'))
485+
file = vdebug.util.LocalFilePath(s.get('filename'))
486486
line = "[%(num)s] %(where)s @ %(file)s:%(line)s" \
487487
%{'num':s.get('level'),'where':where,\
488488
'file':str(file),'line':s.get('lineno')}

plugin/python/vdebug/util.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,22 @@ def __str__(self):
164164
def __repr__(self):
165165
return str(self)
166166

167+
class LocalFilePath(FilePath):
168+
def _create_local(self,f):
169+
"""Create the file name as a locally valid version.
170+
171+
Uses the "local_path" and "remote_path" options.
172+
"""
173+
return f
174+
175+
class RemoteFilePath(FilePath):
176+
def _create_remote(self,f):
177+
"""Create the file name valid for the remote server.
178+
179+
Uses the "local_path" and "remote_path" options.
180+
"""
181+
return f
182+
167183
class FilePathError(Exception):
168184
pass
169185

plugin/vdebug.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,7 @@ function! vdebug:get_visual_selection()
151151
let lines[0] = lines[0][col1 - 1:]
152152
return join(lines, "\n")
153153
endfunction
154+
<<<<<<< HEAD
154155

155156
function vdebug:edit(filename)
156157
try
@@ -159,3 +160,5 @@ function vdebug:edit(filename)
159160
execute 'silent edit' fnameescape(a:filename)
160161
endtry
161162
endfunction
163+
=======
164+
>>>>>>> fix-file-paths

0 commit comments

Comments
 (0)