[fixed] Autocompletion error in lines starting with tabs

Report Bugs Here

[fixed] Autocompletion error in lines starting with tabs

Postby Explogit » Sat Jan 08, 2011 8:42 am

Hi,
I use Editra 0.5.99 as a Python editor on my computer(Windows XP SP2, Python 2.6, wxPython 2.8.11).The auto-completion works pretty well mostly,but I find the popup window doesn't show when editing a line that starts with tabs rather than spaces.

There might be a bug in \src\ed_basestc.py @GetCommandStr:

Code: Select all
line, col = self.GetCurLine()
col = self.GetColumn(self.GetCurrentPos())


Suppose the text before caret is "\twx",when user types a dot to trigger autocomplete,self.GetCurLine()[1] will return 3 and self.GetColumn(self.GetCurrentPos()) will return 6.But line[6-1] is actually out of range and makes the while block below get an empty string.

I think it can be solved by adding something like

Code: Select all
line = line.expandtabs(self.GetIndent())
Explogit
Limited User
 
Posts: 1
Joined: Wed Dec 29, 2010 2:41 pm

Re: Autocompletion error in lines starting with tabs

Postby cody » Sat Jan 08, 2011 8:34 pm

Hi,

Good catch, slightly modified fix applied to svn for next release.


Thanks,

Cody
User avatar
cody
Site Admin
 
Posts: 1315
Joined: Mon Oct 09, 2006 2:49 am
Location: United States


Return to Bug Reports

Who is online

Users browsing this forum: No registered users and 1 guest

cron