From c1f526d0bcf8ef0c9183a2b9bd37bc1092a9dcde Mon Sep 17 00:00:00 2001 From: Madeleine <32415621+SpyHoodle@users.noreply.github.com> Date: Sat, 19 Mar 2022 15:14:18 +0000 Subject: [PATCH] Delete modes directory --- modes/__pycache__/command.cpython-310.pyc | Bin 1335 -> 0 bytes .../__pycache__/command_mode.cpython-310.pyc | Bin 1023 -> 0 bytes modes/__pycache__/insert.cpython-310.pyc | Bin 640 -> 0 bytes modes/__pycache__/normal.cpython-310.pyc | Bin 882 -> 0 bytes modes/command.py | 90 ------------------ modes/insert.py | 33 ------- modes/normal.py | 54 ----------- 7 files changed, 177 deletions(-) delete mode 100644 modes/__pycache__/command.cpython-310.pyc delete mode 100644 modes/__pycache__/command_mode.cpython-310.pyc delete mode 100644 modes/__pycache__/insert.cpython-310.pyc delete mode 100644 modes/__pycache__/normal.cpython-310.pyc delete mode 100644 modes/command.py delete mode 100644 modes/insert.py delete mode 100644 modes/normal.py diff --git a/modes/__pycache__/command.cpython-310.pyc b/modes/__pycache__/command.cpython-310.pyc deleted file mode 100644 index 365f3f38934f43ae0def6acbff81139fe52b3112..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1335 zcmZWp&2Aev5ay8F)k=|MrwCHD4FaV|VF(B!6a{if-J*`7{<%?;*liL4g|S*v(%QRP znM=u$u{yc0kX(ua*0FEU*XWhkp8N_rb+}Rr*CoK&`QiL<=Hn)nN{Qfl`}VWmpUC}f zh0BYg@D=X#9uh$WL?nhT#I#Gn$~0nKCYa#Ak}emHaPjL1xa2R_Xkm%=(+r)IZR^NOvkgPkke-5$35XU<3z}`xjuS-JTnFP zS_Ts>9ow}Jk#OMDqaIMCRorD-f)cASPSty84(uS`Ef<*r?!4tgAY?%1^m0=(+bR%% z?W8qg$7@@KT6RfGZTpK>%NN9sNjrxwHotYnn+jJKGI|C#NFIf%FEV=WEeJOM4Gsf@ zw~b@LfiqD=|0n;|Vbr27iP9M$y_Qp+)AAYgoheb7zGlaY8Q2_Qaiww#gv#n3tNfRv zi|U-~a>mXe;~449s?N2?MvWYy4r{Hf&MW{Szjl}t2q{@>C$DFx^_@qp$L+7b`S!c-cYk=&`SIzq=X?7<{ruwPtL~i(JA6YL z8!BfCO7@jZhsO1VNVT#VrwG-7)B!4kiArT^D!c7h2ak4IyL(S}T5ZE31TPyWV^g$- zc4xo++^|H69A1V6Lxu6iV>!Zia+rjphO5f)4-9jb`^ zo9q^&f2sTE+HegI5+(Ed=Py*ngl(L}B$8j+DW&!wwMjhiSozjJ Dujo9u diff --git a/modes/__pycache__/command_mode.cpython-310.pyc b/modes/__pycache__/command_mode.cpython-310.pyc deleted file mode 100644 index b2ba55f7d3e03398a45eb127caf811e89bfcad7a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1023 zcmY*YOK%e~5cb&KN1lob5&=Y2aa#n*otG$SPF2IBJwPN>C9#`Ln`Bda(~@c;V70&Gpyndi zkkd*D<~yUx737eh4!4P*7ep0T_8$3AnDT@RhB5bIGKYjDkkADKa$d4A0dFY4WC0im z4V(wmIODk2*G;b*MWQ{Cfn!`93*Ax14P~zz#>Tnqi8wTVCmIY|LxHht?F&&EOtySj z4Wogq>d~Ys4>_){JB zWeJO&Qx|*nY~vIYZtNv|1~*B1nyV)XpZg1fJ$$$ByN73LD;+ar;;iszfHE_K6NdA6 zlW?35pXcIy!e)@-Av-T5d;wEuvsU8#f5TN}!EO^Amx($QVp z`7Pn`(Gqs9@1kxXyM%%vLD6J%+=|D#-BQL=@QWsJ9B%k8XN14z42C&TKqyPW_ diff --git a/modes/__pycache__/insert.cpython-310.pyc b/modes/__pycache__/insert.cpython-310.pyc deleted file mode 100644 index 8e3c4c6a190265f02f866d74cf3f3465ac177bf8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 640 zcmY*Wy>8nu5ayATNs^Y|vs?zCIh%Ro!(oxErErp&MsrLVf4lG|-f@K&KXT$urHy_r zJp@iT6r_YMl(b91%Culz#u@kClCH;n9^lvK^oS(kIeL(Unk}U>JyyL;njjxbRmo0n z!~Qw;A5)WOc-1F_8Z;)F!H~*!jVXL`opAPuFmga@a`{_7t) z{&3CzZu8#zx+z)4y8#t?K&6E}q#}v}SNjCq$0;m35qCyJO&uiB`>cIXwq_ zw1J_4;zD_9pl@Jcg26}$sf|}wTo`!1gvU#GV#2&C%WT9GFszasyX^5yXNC>M^gWSR zG2rq}+OJBHs*`ET#Uw4Vvd6R3#!>00l4VxhKbe|PoQiy`g^w<7$T763cO(9SxEFs# z+=;&-ZpYsv>NVpZZ5n|W?EXZF%02YDG)#tyi(&4gpvfF+9N7Z*MbkOk`1d$00C1#p ze?iWu4r-|BjGjRaxIeUG{9aMz!z7e;MNBBgu@tH=Z4TRzi7?IIJ#^jiUkjc0T}=ry zfy$*2Be{dta@T_G$_lR82vL^n!6eh-E=np!h-u6kEW(RVyNQYj*aukAxDZe6XjO#JCJ{s|zWod42*H~G diff --git a/modes/command.py b/modes/command.py deleted file mode 100644 index a85f827..0000000 --- a/modes/command.py +++ /dev/null @@ -1,90 +0,0 @@ -from core import statusbar, utils -import curses - - -def execute(screen, data, commands): - if not commands: - # Quit if there are no commands, don't check anything - return data - - for command in commands: - if command == "w": - # Write to the file - pass - - elif command == "q": - # Goodbye prompt - utils.goodbye(screen, data) - - elif command == "t": - # Theme switcher - if data["statusbar_theme"] == "filled": - data["statusbar_theme"] = "bare" - - else: - data["statusbar_theme"] = "filled" - - else: - utils.error(screen, data, f"Not an editor command: '{command}'") - - return data - - -def activate(screen, data): - # Initialise variables - commands = [] - - # Visibly switch to command mode - statusbar.refresh(screen, data) - screen.addstr(data["height"]-1, 0, ":") - screen.move(data["height"]-1, 1) - - # Main loop - while True: - # Get a key inputted by the user - key = screen.getch() - - # Handle subtracting a key (backspace) - if key == curses.KEY_BACKSPACE: - # Write whitespace over characters to refresh it - screen.addstr(data["height"]-1, 1, " " * len(commands)) - - if commands: - # Subtract a character - commands.pop() - else: - # Exit command mode and enter normal mode if there is nothing left - data["mode"] = "normal" - return data - - elif key == 27: - # Exit command mode and enter normal mode if "esc" is pressed - data["mode"] = "normal" - return data - - elif key in (curses.KEY_ENTER, ord('\n'), ord('\r'), ord(":"), ord(";")): - # Execute commands - data = execute(screen, data, commands) - - # Clear the bottom bar - screen.addstr(data["height"] - 1, 0, " " * (data["width"] - 1)) - - # Return to normal mode after executing a command - data["mode"] = "normal" - return data - - else: - # If any other key is typed, append it - # As long as the key is in the valid list - valid = "abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ!" - if chr(key) in valid and len(commands) < (data["width"] - 2): - commands.append(chr(key)) - - # Join the commands together for visibility on the screen - friendly_command = "".join(commands) - - # Write the commands to the screen - screen.addstr(data["height"]-1, 1, friendly_command) - - # Move the cursor the end of the commands - screen.move(data["height"]-1, len(commands)+1) diff --git a/modes/insert.py b/modes/insert.py deleted file mode 100644 index 71f4252..0000000 --- a/modes/insert.py +++ /dev/null @@ -1,33 +0,0 @@ -from core import statusbar, cursor - - -def execute(data, key): - return data - - -def activate(screen, data): - # Refresh the status bar with a different colour for insert - data["statusbar_colors"] = [8, 12, 14, 2] - statusbar.refresh(screen, data) - - # Refresh the status bar - statusbar.refresh(screen, data) - - # Move the cursor - cursor.move(screen, data) - - # Switch to a line cursor - cursor.cursor_mode("line") - - # Wait for and capture a key press from the user - key = screen.getch() - - # Exit insert mode - if key == 27: - data["mode"] = "normal" - return data - - # Check keybindings - data = execute(data, key) - - return data diff --git a/modes/normal.py b/modes/normal.py deleted file mode 100644 index b727a59..0000000 --- a/modes/normal.py +++ /dev/null @@ -1,54 +0,0 @@ -from core import statusbar, cursor -import curses - - -def execute(data, key): - if key == ord("j"): - # Move the cursor down - data["cursor_y"] += 1 - - elif key == ord("k"): - # Move the cursor up - data["cursor_y"] -= 1 - - elif key == ord("l"): - # Move the cursor right - data["cursor_x"] += 1 - - elif key == ord("h"): - # Move the cursor left - data["cursor_x"] -= 1 - - elif key == ord("i"): - # Exit normal mode and enter insert mode - data["mode"] = "insert" - - elif key == ord("I"): - # Exit normal mode and enter insert mode - data["cursor_x"] += 1 - data["mode"] = "insert" - - elif key in (ord(":"), ord(";")): - # Exit normal mode and enter command mode - data["mode"] = "command" - - return data - - -def activate(screen, data): - # Refresh the status bar - statusbar.refresh(screen, data) - - # Move the cursor - cursor.move(screen, data) - - # Switch the cursor to a block - cursor.cursor_mode("block") - - # Wait for and capture a key press from the user - key = screen.getch() - - # Check against the keybindings - data = execute(data, key) - - return data