Angus Posted July 24, 2008 Share Posted July 24, 2008 (edited) SciTE4AUTOIT3 is powerful in editing AU3 script, i love the autocomplete function of it . sometimes i need to write with other language, i still need these function but it did not work at all, to expand an abbreviation i have to press "ctrl+B", whill in AU3 script both "space" and "ctrl+B" would work. can anyone tell me how to let "space" expand (replace "ctrl+B") works in all files?? Edited July 24, 2008 by Angus Link to comment Share on other sites More sharing options...
Developers Jos Posted July 24, 2008 Developers Share Posted July 24, 2008 (edited) This LUA function (found in AutoItTools.lua) is the trigger for the Abbreviation expand function by typing a SPACE. function AutoItTools:OnChar(c) --~ print("Char:" .. c) if editor.Lexer == SCLEX_AU3 then -- set propercase if props['proper.case'] == '1' then self:ProperCase(c) end -- abbreviations logic will auto expand on space when SCE_AU3_EXPAND. written by Jos van der Zande (JdeB) local ls = editor.StyleAt[editor.CurrentPos-2] if ls == SCE_AU3_EXPAND and c == " " then self:Abbreviations() end end end -- OnChar() As you can see the logic tests for when a SPACE is typed AND the Style of the current word is equal to"SCE_AU3_EXPAND". This style is assigned by the au3lexer and it looks at the table with keywords defined in au3.keywords.abbreviations.properties. Hope I didn't confuse you too much but this should get you started to look at adapting it to another language. Jos muttley Edited July 24, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Angus Posted July 24, 2008 Author Share Posted July 24, 2008 thanks for the reply seems confusing but i got the idea muttley is this mean after i add my own abbreviations to both u3.keywords.abbreviations.properties AND abbreviations.properties, will get things done?sorry...i'm new to both Autoit3 and SciTE Link to comment Share on other sites More sharing options...
Developers Jos Posted July 24, 2008 Developers Share Posted July 24, 2008 thanks for the reply seems confusing but i got the idea muttley is this mean after i add my own abbreviations to both u3.keywords.abbreviations.properties AND abbreviations.properties, will get things done?sorry...i'm new to both Autoit3 and SciTE Nope its not that simple. The issue is that there probably isn't a separate Style available in the other lexers like I created in the AU3 lexer and I don't think you would want to try and expand the words typed every time you hit the space-bar?Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Angus Posted July 25, 2008 Author Share Posted July 25, 2008 (edited) Nope its not that simple. The issue is that there probably isn't a separate Style available in the other lexers like I created in the AU3 lexer and I don't think you would want to try and expand the words typed every time you hit the space-bar? Jos Then how to create separate Style in the other lexers? i mean which files should i edit besides the above 2? ALSO i notice that the SciTE4AutoIt3 autocomplete symbols automatically when i start typing, while in editing other languages it autocompletes symbols only after i press "ctrl+i", so how this works? i found this in the "lua\AutoItAutoComplete.lua" -- Show AutoComplete if it isn't showing already. if not editor:AutoCActive() then scite.MenuCommand(self.IDM_COMPLETE) -- fall through end but i try removing the "lua" folders, that disables "space" expand but autocomplete symbols still works automatically. i'm just curious about how you add this function Edited July 25, 2008 by Angus Link to comment Share on other sites More sharing options...
Angus Posted July 28, 2008 Author Share Posted July 28, 2008 up Link to comment Share on other sites More sharing options...
Developers Jos Posted July 28, 2008 Developers Share Posted July 28, 2008 (edited) Adding a Lexer type will require you to download the scilexer source and update the appropriate lexer which are written in C++. This means you will create/maintain your own version of that language lexer and generate scilexer.dll. To support the space for abbrevs and the Auto popup of the autotcomplete stuff you will have to have a closer look at the provided LUA scripts. Jos Edited July 28, 2008 by Jos SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past. Link to comment Share on other sites More sharing options...
Angus Posted July 28, 2008 Author Share Posted July 28, 2008 Adding a Lexer type will require you to download the scilexer source and update the appropriate lexer which are written in C++. This means you will create/maintain your own version of that language lexer and generate scilexer.dll.To support the space for abbrevs and the Auto popup of the autotcomplete stuff you will have to have a closer look at the provided LUA scripts.JosThanks Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now