Giter Site home page Giter Site logo

tomlin7 / biscuit Goto Github PK

View Code? Open in Web Editor NEW
150.0 150.0 18.0 6.83 MB

A lightweight, fast, and extensible code editor with a wide range of language support

Home Page: https://tomlin7.github.io/biscuit

License: MIT License

Python 100.00%
autocomplete code-editor command-palette debugger extensions goto-definition hacktoberfest python terminal text-editor tkinter vscode

biscuit's Introduction



Python C++ C#

I present this snake in these trying times twitter/tomlin7

peek

Yo!

I'm a goddamn passionate self-taught programmer ๐Ÿ‘จโ€๐Ÿ’ป
a weird pencil artist, and a CS student, etc.

I love all studio ghibli films
listening to olivia rodrigo and conan grey most of the time


Itch.io Twitter Spotify

Top Language GitHub Stats

biscuit's People

Contributors

billyowo avatar cid0rz avatar csp02 avatar dasanurag31 avatar deepsource-autofix[bot] avatar deepsource-io[bot] avatar dependabot[bot] avatar ikeasamoahansah avatar imgbotapp avatar lines-of-codes avatar rohankishore avatar rubemfsv avatar sammie156 avatar tomlin7 avatar vyshnav-vinod avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

biscuit's Issues

File watching

File watching is an important feature for text editors. The editor should be aware of the changes done to the file outside.

Package to be used: watchdog

Sample

import sys
import time
import logging
from watchdog.observers import Observer
from watchdog.events import LoggingEventHandler

if __name__ == "__main__":
    logging.basicConfig(level=logging.INFO,
                        format='%(asctime)s - %(message)s',
                        datefmt='%Y-%m-%d %H:%M:%S')
    path = sys.argv[1] if len(sys.argv) > 1 else '.'
    event_handler = LoggingEventHandler()
    observer = Observer()
    observer.schedule(event_handler, path, recursive=True)
    observer.start()
    try:
        while True:
            time.sleep(1)
    finally:
        observer.stop()
        observer.join()

Maximizing window gives error in linux

Bug

Maximizing window gives error in linux.

File "/home/cid0rz/.pyenv/versions/3.11.4/lib/python3.11/tkinter/init.py", line 2276, in wm_state
    return self.tk.call('wm', 'state', self._w, newstate)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
_tkinter.TclError: bad argument "zoomed": must be normal, iconic, or withdrawn

System Information

  • OS: arch linux
  • Python Version: 3.11

Notifications Feature

Notifications feature for the editor.

  • Prototype notifications window and base notification (standalone)
  • Integrate to the editor
  • Notifications button on statusbar
  • Notification types
  • Notification timeout
  • Notification buttons and events

Not working

Bug

Describe the bug

When starting biscuit I get this error

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Ramit Katyal\git\Biscuit\biscuit\__main__.py", line 17, in <module>
    from biscuit.app import App
ModuleNotFoundError: No module named 'biscuit'
21.08.2023_10.20.34_REC.mp4

(i have custom powershell prompt dont mind it)
By the way I already have the libraries installed

System Information

  • OS: Windows 10
  • Python Version: 3.11

Extensions API (major feature)

  • notifications
  • logger
  • custom commands
  • palette
  • sidebar slots for custom views
  • all utils
  • custom editor types
  • menubar, other context menus
  • custom shells for terminal

Notifications are rendered above system modals

Bug

What it says on the tin. Leave a notification open, and then choose to Open Folder or Open File so that a system dialog appears.
The notification remains rendered on top.

Discord_V1YNrzGeWN

System Information

  • OS: Windows 11 22H2 (22621.1848)
  • Python Version: 3.11.4

Stacking order and other Window issues in Linux (Wayland + GNOME)

Bug

Custom titlebar doesn't really work well on Linux. Because of .wm_overrideredirect() it stays always on top, and the filedialog goes behind the window. Resizing doesn't work, and any of the menus either. The menus open, but as soon as mouse is moved, they disappear, and selecting items with the keyboard doesn't work either.

Originally posted by @rdbende in #84 (comment)

System Information

  • OS: Wayland + GNOME, using Mutter WM
  • Python Version: 3.11

Tetris doesn't work

Bug

When i click "play tetris" from the palette, Snake is being played instead of Tetris (my english sucks ik sorry)

System Information

  • OS: Cumulative Update for Windows 11 Insider Preview (10.0.22631.1972) (KB5027295)
  • Python Version: 3.11.4
  • CPU : Ryzen 5 5600H

Undo-Redo functions

Undo

  • Event
  • Base class function
  • Keybinds <Control-z>

Redo

  • Event
  • Base class function
  • Keybinds <Control-y> or <Control-Shift-z>

Keyboard shortcuts

Feature

Add keyboard shortcuts for improved accessibility.

Some things to keep in mind:

Menus should be accessible using Alt+<key>, where the key in question is whichever is designated as the activation key for the menu in question. Holding Alt in any desktop app should underline one unique letter.

Example from VS Code:
image

This hints that using the shortcut Alt+F will activate the File menu. If Alt is held while a menu is open thereafter, the options in that menu should also have uniquely underlined letters. For example, the X in Exit. This means you can exit the app by using Alt+F, followed by the X key.
image

Integrated Terminal Manager

Integrated Terminal Manager

To open multiple integrated terminals inside the editor, terminal should be replaced with a terminal manager.
The terminal tabs can be shown aside for switching in bw terminals.

checklist to be added

If a single file is opened, pathview is not working [ISSUE]

Bug

If a single file is opened, pathview is not working, modify code so that if the opened file doesn't belong to active directory, then the absolute path irrespective of active directory is shown as breadcrumbs

System Information

  • OS: [e.g. iOS]
  • Python Version: [e.g: 3.10]

Errors when loading Biscuit

When I try to load Biscuit I get the following:

  • ImportError: cannot import name 'windll' from 'ctypes'
  • ModuleNotFoundError: No module named 'hintedtext' (after commenting both imports of windll (I would recommend using isort on the project ;) )).
  • ModuleNotFoundError: No module named 'filetype' ( After removing the hintedtext)
  • ModuleNotFoundError: No module named 'tkextrafont'
  • ModuleNotFoundError: No module named 'tksvg' (tksvg has actually been having issues downloading for a while and there is a PR looking to fix the module)
  • NameError: name 'git' is not defined
  • Error shows that git isn't installed even though I use it almost every day XD
  • Probably many more I can't get to yet.

System Information

  • OS: MacOS
  • Python Version: 3.11

I Never See A IDE Like This

This is sooooooooooo awesome ! This editor has a soooooooooooo awesome and clear outlook, it just build start tk but it really like a 21st Century .

And I look inside the source code, it implement sooooooooo awesome and clear structure too. I can't stop myself that is the universal best IDE Biscuit !

Regarding Malicious Extensions & Safe Execution of Extensions

Bug

Extensions are bare Python scripts executed without any restrictions currently, this should be handled. This may lead to malicious extensions. To take care of the issue, a sandboxed environment shall be used to execute the extensions!

Task:

Linux support

The editor is currently not supporting linux operating system.

Bugs

Bugs identified so far.

  • keysym <Control-`> doesn't work
  • cmd is not recognized in linux
  • tk-extrafont library have trouble installing in linux

Fixes:

  • #21
    A class to hold all needed data of the working machine. This shall include operating system, version, python version, etc.
  • Configure new keysym to replace <Control-`> when on linux.
  • instead of cmd use bash in linux (make choice based on platform.system())
  • add fixes to avoid the error while installing tk-extrafont in linux

Extensions Manager & Repository

Feature

  • extensions manager
  • extensions repository
  • extensions sidebar-view
  • extensions fetching
  • extensions installation
  • extensions uninstallation
  • extensions enable/disable

Biscuit won't launch without Git installation

Bug

When there is no git installed and added to PATH, biscuit simply fails to open up due to unhandled exceptions at core/components/git.

To handle this, import the core/components/git module with proper exception handling.

System Information

  • OS: Windows 10
  • Python Version: 3.10

Navigating menus causes main window to lose focus

Bug

This in turn causes a visual glitch where when you switch to a new menu, the main window regains focus for about a frame and then loses it again when the new menu opens.

python3.11_nnLVtchE5O.mp4

System Information

  • OS: Windows 11 22H2 (22621.1848)
  • Python Version: 3.11.4

Code Folding

Feature

implement code folding to the text editor

System data class

A class to hold all needed data of the working machine. This shall include operating system, version, python version, etc.

AttributeError: 'TclError' object has no attribute 'message'

Bug

Describe the bug

I do python biscuit and it shows me that:

Traceback (most recent call last):
  File "C:\Program Files\Python311\Lib\site-packages\tkextrafont\__init__.py", line 118, in load
    window.tk.eval("package require extrafont")
_tkinter.TclError: extra characters after close-brace

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\__main__.py", line 15, in <module>
    app = App(dir=dir)
          ^^^^^^^^^^^^
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\app.py", line 36, in __init__
    self.setup()
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\app.py", line 48, in setup
    self.setup_configs()
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\app.py", line 93, in setup_configs
    self.settings = Settings(self)
                    ^^^^^^^^^^^^^^
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\core\settings\__init__.py", line 31, in __init__
    self.setup_properties()
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\core\settings\__init__.py", line 64, in setup_properties
    self.setup_font()
  File "C:\Users\Administrator\Downloads\Biscuit-main\Biscuit-main\biscuit\core\settings\__init__.py", line 76, in setup_font
    self.firacodefont = extra.Font(file=os.path.join(self.base.resdir, "fonts/firacode/firacode.ttf"), family="firacode")
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python311\Lib\site-packages\tkextrafont\__init__.py", line 90, in __init__
    load(root)
  File "C:\Program Files\Python311\Lib\site-packages\tkextrafont\__init__.py", line 120, in load
    if "libfontconfig" in e.message:
                          ^^^^^^^^^
AttributeError: 'TclError' object has no attribute 'message'

System Information

  • OS: Windows
  • Python Version: 3.11.4

Terminal should be opened at Active Directory

Feature

Currently the terminal is opened at the editor executable's directory, instead the terminal shall be opened at the currently active directory in editor.

  • a change directory method for the terminal
  • close terminals when directory changes
  • open new terminals at base.active_directory

Biscuit does not account for High DPI displays

Bug

To show what I mean, here is a comparison of the UI scale between VS Code and Biscuit.

explorer_M2dnfy5FbZ

The entire UI is inefficient to navigate at this scale, and the app should scale based on the system DPI settings. This could be achieved by using the GetDpiForMonitor syscall on Windows, or equivalent syscalls on other platforms. Unfortunately, I do not know the functions for other systems.

System Information

  • OS: Windows 11 22H2 (22621.1848)
  • Python Version: 3.11.4

File watcher [FEATURE]

Feature

import os 
from tkinter import *
from tkinter import ttk
from watchdog.observers import Observer
from watchdog.events import FileSystemEventHandler

class DirectoryWatcher(FileSystemEventHandler):
    def __init__(self, tree):
        self.tree = tree
        self.update_tree()

    def on_created(self, event):
        self.update_tree()

    def on_deleted(self, event):
        self.update_tree()

    def on_modified(self, event):
        self.update_tree()

    def update_tree(self):
        self.tree.delete(*self.tree.get_children())
        root_node = self.tree.insert("", "end", text="root", open=True)
        for root, dirs, files in os.walk("./Biscuit"):
            dir_node = self.tree.insert(
                root_node, "end", text=root.split("/")[-1], open=True
            )
            for file in files:
                self.tree.insert(dir_node, "end", text=file)

root = Tk()
tree = ttk.Treeview(root)
tree.pack()

watcher = DirectoryWatcher(tree)
observer = Observer()
observer.schedule(watcher, "./Biscuit", recursive=True)
observer.start()

root.mainloop()

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.