Remillard / VHDL-Mode

A package for Sublime Text that aids coding in the VHDL language.
MIT License
40 stars 10 forks source link

Copy subprogram has a bug #90

Closed Remillard closed 5 years ago

Remillard commented 6 years ago

The following function declaration doesn't seem to copy correct for subprogram copying

    -- Padding function
    function make_miso_word (
            d_in : std_logic_vector) 
        return std_logic_vector;

and returns the following error:

vhdl-mode: Subprogram beginning found.
Traceback (most recent call last):
  File "C:\Program Files\Sublime Text 3\sublime_plugin.py", line 818, in run_
    return self.run(edit)
  File "C:\Users\mnorton\AppData\Roaming\Sublime Text 3\Packages\VHDL Mode\vhdl_subprogram.py", line 81, in run
    endpoint = self.find_end(startpoint, _subprogram)
  File "C:\Users\mnorton\AppData\Roaming\Sublime Text 3\Packages\VHDL Mode\vhdl_subprogram.py", line 51, in find_end
    check = subprogram.subprogram_end(util.line_at_point(self, next_point))
  File "C:\Users\mnorton\AppData\Roaming\Sublime Text 3\Packages\VHDL Mode\vhdl_lang.py", line 1042, in subprogram_end
    if close_pos:
NameError: global name 'close_pos' is not defined
Remillard commented 5 years ago

Tracked this down to the use of the parenthesis operation. I think it's creating new instance of the parethesis tracker every line instead of keeping the old one.

Remillard commented 5 years ago

Yep, it was that. Rejiggered the use of a class instance and it seems to copy just fine now.