80 Commits

Author SHA1 Message Date
Luke Wilson
d96c2f6f03 Refactored cursor architecture into buffer module 2021-04-12 17:38:29 -05:00
Luke Wilson
59856c5e41 Panel: change reference to Focused -> focused 2021-04-12 10:53:25 -05:00
Luke I. Wilson
e0079bbdb5 Panel: inherit from baseComponent struct 2021-04-08 18:39:06 -05:00
Luke I. Wilson
70e32e0b5c Merge branch 'panels' 2021-04-08 13:05:13 -05:00
Luke I. Wilson
8346c52167 Added baseComponent to ui to save boilerplate lines 2021-04-08 12:41:24 -05:00
Luke I. Wilson
14ba338de9 PanelContainer: bug fix on destroying a panel
This commit fixes a bug where destroying a Panel with a parent of
kind PanelKindSplit... causes the selected to become that split
panel, instead of a child. Now, it chooses the leftmost child of
that parent panel.
2021-04-07 23:03:20 -05:00
Luke I. Wilson
5df772e568 TextEdit: only hide cursor when unfocused 2021-04-07 22:05:58 -05:00
Luke I. Wilson
baafcf3d5c TextEdit: Colorscheme "Column" style + changed column appearance 2021-04-07 21:45:38 -05:00
Luke I. Wilson
cdeb3be359 TabContainer & Theme fixes to better show focused state of TabContainer and MenuBar 2021-04-07 21:06:36 -05:00
Luke I. Wilson
e7e459b16f PanelContainer: code cleanup 2021-04-07 14:55:20 -05:00
Luke I. Wilson
56b89c6079 PanelContainer: Implement cycling selection 2021-04-07 13:56:32 -05:00
Luke I. Wilson
459087e6d8 PanelContainer: removed multiple comments 2021-04-06 14:35:55 -05:00
Luke I. Wilson
389276ee34 PanelContainer: Bug fixes and integration 2021-04-06 11:14:17 -05:00
Luke I. Wilson
c40be89564 PanelContainer: Floating Panels, but not quite? 2021-04-06 10:06:02 -05:00
Luke I. Wilson
95e4db4d3e PanelContainer: SwapNeighborsSelected() to split left and split top 2021-04-05 17:31:16 -05:00
Luke I. Wilson
cf5803c464 Splitting Panels 2021-04-05 17:15:57 -05:00
Luke I. Wilson
eb8142ea8e PanelContainer: SetFocus and HandleEvent properly 2021-04-05 17:03:52 -05:00
Luke I. Wilson
25b416da3d Injected new PanelContainer into mainloop to replace TabContainer 2021-04-05 16:55:16 -05:00
Luke I. Wilson
03c8c3bcad Created Panel and PanelContainer untested code 2021-04-05 16:22:40 -05:00
Luke I. Wilson
3982628653 Ran go fmt *.go on all sources 2021-04-04 13:15:31 -05:00
Luke I. Wilson
e115855491 TextEdit highlighting: update lang definition 2021-04-04 11:09:34 -05:00
Luke I. Wilson
ca68b8d7fa TextEdit: naive fix to rendering selection around hard tabs 2021-04-04 09:36:56 -05:00
Luke I. Wilson
28e9af70eb InputField: replace buffer with byte buffer and update appearance 2021-04-04 08:30:09 -05:00
Luke I. Wilson
d1dd389dba Main: more robust error handling.
Previously, the editor would panic at any error. After I recently
implemented dialogs, I changed all panics to create error dialogs,
instead. This will make the editor more stable.
2021-04-02 14:30:38 -05:00
Luke I. Wilson
f64af6fa29 DrawStr: made more efficient and renders newline characters
Before, DrawStr would copy all bytes into a []rune slice, and later
copy the rune slice (by accident) in the for i, v := range loop. Now,
it uses a []byte slice and iterates with for i := range slice.
2021-04-02 13:30:37 -05:00
Luke I. Wilson
0dcdd62773 UI: removed WindowContainer, and replaced it with DrawWindow function 2021-04-01 20:34:18 -05:00
Luke I. Wilson
a4d5f3ccf4 Highlighter: fix bug causing out of bounds access when endLine > len of internal lines 2021-04-01 16:19:14 -05:00
Luke I. Wilson
239793aa2c Rope test: add case for TestRopeSlice 2021-04-01 16:16:47 -05:00
Luke I. Wilson
25f5262b6a Rope: fix bug in Slice() causing out-of-bounds access 2021-04-01 16:14:39 -05:00
Luke I. Wilson
2cd41fc62d TextEdit: update highlighting for .go files, make strings lazy match 2021-04-01 14:40:38 -05:00
Luke I. Wilson
58c8de3068 Rope: Added LineColToPos, and optimized Highlighter's UpdateLines() 2021-04-01 14:16:51 -05:00
Luke I. Wilson
f829b37d0c TextEdit & Highlighting: performance improvements & changes to architecture
I ran pprof to find what was causing stuttering, and found it to be the
getTabCountInLineAtCol function in TextEdit, because it was iterating
many bytes of the buffer, for each rune rendered. Replaced it with a more
optimal system. Also changed the architecture of the highlighting system
to use a single RegexpRange structure for all regular expressions. This
allows for optimizations and multiline matches in the future.
2021-04-01 12:05:17 -05:00
Luke I. Wilson
37589144b5 TextEdit: Add syntax highlighting for Go files 2021-03-30 23:00:32 -05:00
Luke I. Wilson
aaf377ccd5 TextEdit: account for tab offsets when highlighting 2021-03-30 22:21:56 -05:00
Luke I. Wilson
de921419ce Rope buffer tests: remove unnecessary 't.Fail()` everywhere 2021-03-30 22:17:41 -05:00
Luke I. Wilson
a79227e97c Rope buffer: Fix bug in PosToLineCol and add test case 2021-03-30 22:14:02 -05:00
Luke I. Wilson
a90a367122 TextEdit: Replaced line-based rendering with character-based rendering.
With line-based rendering, it was more efficient but we were unable
to perform syntax highlighting, or more specifically, individual character
stylings. With this change, the rendering is likely to be slightly less
performant (because it is not as simple as string slicing) but much more
powerful.
2021-03-30 20:44:09 -05:00
Luke I. Wilson
9a85e8efef Create and initialize Highlighter in TextEdit 2021-03-27 13:42:11 -05:00
Luke I. Wilson
1161888660 Made quick chars use an index 2021-03-25 11:27:43 -05:00
Luke I. Wilson
8d532fd9b7 Renamed diesel to qedit 2021-03-24 18:37:12 -05:00
Luke I. Wilson
d47e407063 Fixed bug in saving files: was missing os.O_TRUNC bit flag 2021-03-24 17:47:13 -05:00
Luke I. Wilson
9133ab55d0 Bounds check delete regions in rope buffer 2021-03-24 11:40:18 -05:00
Luke I. Wilson
296fa8b4ac Remove comment 2021-03-23 18:47:58 -05:00
Luke I. Wilson
3be12bdff1 Use Buffer.WriteTo method for writing buffer to file 2021-03-23 18:13:55 -05:00
Luke I. Wilson
40e1b40672 Add and replace []string buffer with ropes 2021-03-23 15:14:23 -05:00
Luke I. Wilson
bd6f1cf79e Added RopeBuffer Buffer implementation 2021-03-22 16:10:23 -05:00
Luke I. Wilson
817b2c66c4 Complete revamp of shortcut system in Menu 2021-03-20 23:10:23 -05:00
Luke I. Wilson
8db551ceae Bug fix with focusing wrong component after using menu item 2021-03-20 21:51:34 -05:00
Luke I. Wilson
119aac195e Bug fixes for previous features 2021-03-20 18:03:38 -05:00
Luke I. Wilson
df106cbbff Render shortcuts on Menus 2021-03-20 17:35:32 -05:00