Jump to content

SciTE v 3.20 Beta available


Jos
 Share

Recommended Posts

I would like to be able to toggle a bookmark (Ctrl + F2) by clicking the margin next to the line number.

Can this be done with the AutoIt package or do I need to request it be added to the original SciTE?

Link to comment
Share on other sites

  • Developers

I would like to be able to toggle a bookmark (Ctrl + F2) by clicking the margin next to the line number.

Can this be done with the AutoIt package or do I need to request it be added to the original SciTE?

I use the standard SciTE package released by Neil and are limiting the mods made, so this will feature have to come from there.

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

I use the standard SciTE package released by Neil and are limiting the mods made, so this will feature have to come from there.

Okay, I made a feature request but Neil rejected it because clicking in the margin is already used for selecting lines.

Given that SciTE can already detect margin clicks, could the bookmark toggling be added by a LUA script?

Link to comment
Share on other sites

I don't see why a double click on the margin couldn't toggle a bookmark keeping the current behavior of a single click selecting the line. That is analogous to Visual Studio's breakpoint toggle behavior which visually looks similar to a bookmark (though obviously different functionally).

As for Lua, there is an OnMarginClick() event that might be useful to implement the functionality.

Link to comment
Share on other sites

As for Lua, there is an OnMarginClick() event that might be useful to implement the functionality.

Thanks for the tip, Valik. After reading various documents, I have implemented similar functionality which I find to be quite satisfactory.

OnMarginClick() didn't work like I expected and caused too many problems, so I used OnDoubleClick(). Now when I double-click a line, a bookmark is toggled on/off for that line. I think this is just as good, if not better, than the margin clicking version found in Notepad++.

Here are the installation instructions for anyone that is interested. In anyone sees something I did wrong, please let me know.

In

C:\Program Files\AutoIt3\SciTE\LUA make a file named ToggleBookmark.lua, and put this code in that file.

--------------------------------------------------------------------------------
-- This library will enable bookmark toggling when double-clicking a line.
--------------------------------------------------------------------------------
ToggleBookmark = EventClass:new(Common)
function ToggleBookmark:OnDoubleClick()
    scite.MenuCommand(IDM_BOOKMARK_TOGGLE)
    return false
end

In the same directory, open SciTEStartup.lua and add this line after the others.

LoadLuaFile("ToggleBookmark.lua")

Restart SciTE, load a file, and double-click a line to see it in action. This script will work on any file and not just AutoIt scripts.

Is there somewhere outside of the scite source that I can find the menucommand IDs?

I'm not sure this qualifies as "outside of the scite source" but the Menu IDs are defined in SciTE.h which can be viewed here.

http://scintilla.hg.sourceforge.net/hgweb/scintilla/scite/file/tip/src/SciTE.h

Link to comment
Share on other sites

Not that I could find. Simply replacing OnDoubleClick with OnMarginClick will toggle a bookmark when the margin is single-clicked. I encountered two problems with using OnMarginClick though.

First, folding points are in the margin, so toggling a fold will also toggle a bookmark at the same time.

The bigger problem was that I can't find any way to get the line number the margin was clicked at. The bookmark will always be toggled at the line where the caret is located. If the caret is at line 2 and you click the margin at line 5, the bookmark will be toggled at line 2.

Link to comment
Share on other sites

  • 4 weeks later...

Can I add to SciTE some colors for specific words?

For example I added a new color for AutoIt Objects functions name but I want one more and for some reason doesn't work.

This is how it looks like au3.properties:

# Autoit keywords

keywords.$(au3)=$(au3.keywords.keywords)

# Autoit functions

keywords2.$(au3)=$(au3.keywords.functions)

# Autoit macros

keywords3.$(au3)=$(au3.keywords.macros)

# Autoit Send Keys

keywords4.$(au3)=$(au3.keywords.sendkeys)

# Pre-Processor

keywords5.$(au3)=$(au3.keywords.preprocessor)

# Special

keywords6.$(au3)=$(au3.keywords.special) $(autoit3wrapper.keywords.special)

# Expand abbreviations

keywords7.$(au3)=$(au3.keywords.abbrev)

# UDFS

keywords8.$(au3)=$(au3.keywords.udfs) $(au3.keywords.user.udfs)

# AutoIt Objects

keywords9.$(au3)=$(au3.keywords.obj)

#Background

style.au3.32=style.*.32=$(font.base),back:#F0F4F9

# Brace highlight

style.au3.34=fore:#0000FF,bold,back:#F0F4F9

# Brace incomplete highlight

style.au3.35=fore:#009933,italics,back:#F0F4F9

# White space

style.au3.0=fore:#000000,back:#F0F4F9

# Comment line

style.au3.1=fore:#009933,italics

# Comment block

style.au3.2=fore:#669900,italics

# Number

style.au3.3=fore:#AC00A9,bold,italics

# Function

style.au3.4=fore:#000090,bold,italics

# Keyword

style.au3.5=fore:#0000FF,bold

# Macro

style.au3.6=fore:#FF33FF,bold

# String

style.au3.7=fore:#9999CC,bold

# Operator

style.au3.8=fore:#FF0000,bold

# Variable

style.au3.9=fore:#AA0000,bold

# Sent keys in string

style.au3.10=fore:#FF8800,bold

# Pre-Processor

style.au3.11=fore:#F000FF,italics

# Special

style.au3.12=fore:#A00FF0,italics

# Expand abbreviations

style.au3.13=fore:#FF0000,bold

# Com Objects

style.au3.14=fore:#0000FF,bold,italics

#Standard UDF's

style.au3.15=fore:#0080FF,italics,bold

# AutoIt Objects

style.au3.16=fore:#808080,italics,bold

I tried to add new lines like below but without success:

# Others

keywords10.$(au3)=$(au3.keywords.others)

# Others

style.au3.17=fore:#FF8000,italics,bold

Any idea?

When the words fail... music speaks.

Link to comment
Share on other sites

You don't just add new keywords and the lexer magically knows what to do. If Jos has not written support for 9 different sets of keywords then you are confined to 8 sets.

Link to comment
Share on other sites

  • 1 month later...
  • Developers

Updated SciTE beta to v3.20 released recently.

See first post.

Edited 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

Guest
This topic is now closed to further replies.
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...