No response with the tab-key, cause wrong template file
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Snipper |
New
|
Undecided
|
Unassigned |
Bug Description
My report contains two parts,
Part one:
When you hit tab the python source code
except KeyError:
# There is no buffer at hand for the current filetype, try redetecting the type
self.
try:
if buffer == None:
raise NoTemplateFound
except:
raise NoTemplateFound
runs, but it doesn't work. The code should have this line:
return buffer
and if the registerBuffer() method change behaviour you may need this row, with assignment:
buffer = self.buffers[
instead of
self.buffers[
look at this version of the code to see what I did to solve it (CHANGES MAKED WITH << >>):
except KeyError:
# There is no buffer at hand for the current filetype, try redetecting the type
try:
<< buffer = self.buffers[
if buffer == None:
raise NoTemplateFound
<< return buffer >>
except:
raise NoTemplateFound
Now to the second part of my patch, if you use this row
if filetype.lower() in file.lower():
in this part of the code
for file in self.template_
if filetype.lower() in file.lower():
bfile = open(self.
return Buffer(bfile)
you will end up using GtkRC-templates.xml instead of C-templates.xml when you edit a C file.
Solution, use this line:
if file.lower(
Good luck and happy hacking...