Giter VIP home page Giter VIP logo

geanylua-scripts's Introduction

GeanyLua Scripts

This repository contains some GeanyLua scripts:

  • auto-sidebar: Automatically hide and show the sidebar depending on document type.

  • column-markers: Show long-line markers at multiple columns, in different colors.

  • open-config: Open config folder in file manager when preferences button is pressed.

  • toggle-editor: Hide the editor. Useful in combination with some sidebar plugins.

  • toggle-menu-bar: Hide the menu bar. For those who like minimal interfaces.

  • switch-views: Switch among views: editor-only → editor+sidebar → sidebar-only.

Usage

  • Read the GeanyLua Introduction for general installation and usage instructions. If "Lua Script" is not shown in the Plugin Manager, make sure the GeanyLua plugin is installed. See distro-specific documentation for details.

  • Scripts are in their own folders for organization, but they were written to be placed directly in the GeanyLua config folder. On Linux, the folder is located at ~/.config/geany/plugins/geanylua/

  • You may need to create additional folders, like ~/.config/geany/plugins/geanylua/events/

  • When new scripts are added, Geany may need to be restarted.

  • When old scripts are modified, Geany usually does not need to be restarted.

License

Licensed under the GPLv2.

geanylua-scripts's People

Contributors

xiota avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

geanylua-scripts's Issues

toggle-menu: sometimes the shortcut has to be pressed two times

issue 1
When I restart the computer and I open Geany for the first time and if I press F12 nothing happens (my shortcut is F12 to toggle the menu-bar). Then after the second press of F12 it works fine, so the menu-bar appears and disappears after each press of F12.

issue 2
The same issue happens when the menu-bar is not there any more and then I close Geany. After a restart of Geany I need to press two times F12 to let disappear the menu-bar. Then the menu-bar appears and disappears after each press of F12.

Geany 1.37.1, Lubuntu 21.04

Add one script that contains toggle-menu-bar, auto-sidebar and switch-views

If I build myself a combination of toggle-menu-bar, auto-sidebar and switch-views, then it takes time. And I have to be careful that I don't make a mistake.
So, the idea is to offer on the webpage https://github.com/xiota/geanylua-scripts one script that contains the three scripts. Its name could be:

toggle-menu-bar_auto-sidebar_switch-views

Then users would need to do only those steps:

  • download the zip,
  • unzip the file,
  • copy the folder toggle-menu-bar_auto-sidebar_switch-views,
  • paste the copied folder inside the folder plugins, and
  • rename the pasted folder to geanylua.

TUTORIAL: auto-sidebar small version, so if switch-views are not used

At the moment there is a big version of auto-sidebar at https://github.com/xiota/geanylua-scripts, in case also switch-views are used.

When switch-views didn't exist, there was only a small version of auto-sidebar. Maybe someone is not interested in switch-views, so the small version of auto-sidebar could be interesting.

In the next comment is the small version of auto-sidebar that existed in the past at https://github.com/xiota/geanylua-scripts.

Shortcuts for Geany Preview

Shortcut names
1: Toggle between only editor and editor/sidebar
2: Toggle between only editor and editor/sidebar; focus stays in the editor
3: Toggle between only sidebar and editor/sidebar
4: Toggle between only editor and only sidebar
5: Exit "Toggle between only editor and only sidebar"

Shortcuts in action
1: if "only editor" is not shown, then (show "only editor" & put editor in focus), else (show editor/sidebar & put sidebar in focus)
2: if "only editor" is not shown, then (show "only editor" & put editor in focus), else (show editor/sidebar & put editor in focus)
3: if "only sidebar" is not shown, then (show "only sidebar" & put sidebar in focus), else (show editor/sidebar & put editor in focus)
4: if the shortcuts 1, 2 and 3 are blocked, then (if "only editor" is shown, then (show "only sidebar" & put sidebar in focus), else (show "only editor" & put editor in focus)); if editor/sidebar is shown, then (block the shortcuts 1, 2 and 3 & show "only editor" & put editor in focus)
5: if the shortcuts 1, 2 and 3 are blocked, then (unblock the shortcuts 1, 2 and 3 & show editor/sidebar & put editor in focus)

Explication
Toggling the shortcut 1 or toggling the shortcut 2 is interesting, if one don't want to see the whole result, so if one don't want to see only the sidebar. The shortcut 1 is more for testing functionality change, like shortcuts on the webpage, while the shortcut 2 is more for testing content change. The starting point of shortcut 4 is editor/sidebar, else the shortcut 4 creates too much confusion.

Remark
This report is based on the knowledge of xiota/geany-preview#37, xiota/geany-preview#38 and xiota/geany-preview#40.
The shortcut 2 exists already https://github.com/xiota/geanylua-scripts/tree/main/toggle-editor as stand-alone-version (,so without state file; the state file is mentioned in xiota/geany-preview#37).

toggle_menu_bar.lua instead of toggle-menu.lua

I would not call the document
toggle-menu.lua
but
toggle_menu_bar.lua
because it is not about the menu, it is about the menu bar.
I would also re-change in all documents menu to menu bar.
So, I would also re-change this:
toggle_menu-hidden
to
toggle_menu_bar-hidden
Maybe some more words need to be changed, so that the scripts work properly like now.

Remark
If one use toggle_menu-bar.lua, then in Preferences, in Keybindings, the hyphen will not appear, so I think it is better to use the underscore, so like this: toggle_menu_bar.lua.

auto-sidebar.lua does not respect fountain any more

steps to reproduce
just down below the Mardown-line I added this line in auto-sidebar.lua

 ["Fountain"] = show_sidebar,

I saved the document
I restarted Geany

result
there is no sidebar when a fountain-document is in the editor;
to see the Preview I have to press the shortcut "Toggle Sidebar"

expectation
there should be a sidebar when a fountain-document is in the editor

alternative
I tried also this line

 ["FOUNTAIN"] = show_sidebar,

and I tried also to put it just before the HTML-line

remark
last year it was working, I think so

remark that does not belong to this issue
last year the font-color was all in white in the Preview, I think so; but now it is black and white; the black part is too hard to read; I tried to change the color in fountain.css; but it didn't work

Focus does not work correctly when using two shortcuts in Geany Preview

The two shortcuts Toggle sidebar 2 and Switch view (editor↔sidebar)
If one of the two shortcuts is pressed two times, then the content-area of the Preview-tab is not in focus.

Help
If one want to put the focus on the content-area of the Preview-tab after having pressed one of the two shortcuts, then a help could be to press two times the shortcut Toggle focus between editor and the sidebar (the current built-in-shortcut of Geany Preview).

Possible solution to fix this issue
A possible solution is to fork Geanylua, so to create some kind of GeanyLua special, that allows to have access to a common library. So, then in Geany Preview the shortcut Toggle focus between editor and the sidebar needs to be removed and needs to be pasted in the library, so both plugins (Geanylua special and Geany Preview) have access to it.

History
The knowledge of this issue is based on #7.

Graphical glitch when using some shortcuts in Geany Preview

When using some special shortcuts (Toggle editor 1, Toggle editor 2 and both Switch Views), then one can see the scrollbar of the Preview for a part of the second somewhere else.

If for example the sidebar is on the right side, and if the widths of editor and sidebar are about 3:1 (see image 1), then, after having pressed some shortcuts, the sidebar is moving to the left side (see image 2), so that the scrollbar of the Preview is more on the left side, and then the content expands to the right side (see image 3). The images are screenshots from a video that I did with a digital camera.

image 1
1

image 2
2

image 3
3

History
The glitch was mentioned for the first time in #4 (comment) in point 3, and later in #7 (comment).

Environment
Lubuntu 23.04 with Geany 1.38.

Remark
Because you wrote that you don't see the graphical glitch at all (see #7 (comment)):
Maybe it would be good if you notice your environment like CPU, RAM, distribution name, Geany version number, and graphic card, so if someone feels too much disturbed by the graphical glitch, there is at least the possibility to change the environment. And maybe the values could help to find the cause of the issue.

One additional shortcut for Geany Preview: Toggle sidebar visibility+focus

If one day the focus problem will be solved in Geany Preview (see also xiota/geany-preview#5 and xiota/geany-preview#15), there is one shortcut that could be added to the shortcuts in Geany Preview. Instead of
Toggle sidebar visibility
there could be two shortcuts with this kind of names:
Toggle sidebar visibility+focus and
Toggle sidebar visibility; focus stays in the editor.

This report is based on #7.
This suggestion for improvement was mentioned for the first time on xiota/geany-preview#38 (comment).

auto-sidebar does not respect "Hide sidebar" during tab-browsing

condition

  • for txt-documents: the sidebar does not appear
  • for html-documents: the sidebar does appear

issue a)
steps to reproduce
1: put a html-document in focus
2: press shortcut "Hide sidebar" (result: there is no sidebar any more)
3: put a txt-document in focus
4: put back a html-document in focus
result: the sidebar is completely empty
expectation: there should be no sidebar

possible solution
I don't know how to program lua-scripts, but maybe a separate lua-script for the memory could be interesting, to remember if sidebar is disabled.





REMARK
if the issue above was solved, it could be that the next two following issues will not appear any more

issue b)
steps to reproduce
1: put a html-document in focus
2: press shortcut "Hide sidebar" (result: there is no sidebar any more)
3: put a txt-document in focus
4: put back a html-document in focus
result: the sidebar is completely empty, and the shortcut "Hide sidebar" need to be pressed 3x to let appear again the sidebar
expectation: there should be no sidebar, and by pressing 1x the shortcut "Hide sidebar", the sidebar should appear

issue c)
steps to reproduce
1: put a html-document in focus
2: press shortcut "Hide sidebar" (result: there is no sidebar any more)
3: close Geany
4: reopen Geany
result: the sidebar is completely empty
expectation: there should be no sidebar, and by pressing 1x the shortcut "Hide sidebar", the sidebar should appear

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.