about summary refs log tree commit diff stats
path: root/zet.tlv
diff options
context:
space:
mode:
authorKartik K. Agaram <vc@akkartik.com>2022-02-07 22:54:17 -0800
committerKartik K. Agaram <vc@akkartik.com>2022-02-07 22:54:17 -0800
commit504573a0de604bfeb04d4fe938fca8f42da55eca (patch)
tree896786f542ee92007703561875aa2be516f2a27f /zet.tlv
parent0d16c7c690c0608630082a0470c500d9b3f25f8a (diff)
downloadteliva-504573a0de604bfeb04d4fe938fca8f42da55eca.tar.gz
move most Teliva menus to the right
The problem I'm running into is that apps might want to perform their
own editing. So I can't take up prime estate like the ctrl-e hotkey or a
menu name of 'edit'.

I'm still prioritizing rendering Teliva's edit and permissions menu. If
the window is too narrow the app's settings will be overwritten and
Teliva's hotkeys will be preferentially displayed. Seems safer.
Diffstat (limited to 'zet.tlv')
0 files changed, 0 insertions, 0 deletions
pecs/aerc/commit/commands/account/next-result.go?h=0.4.0&id=2a0961701c4cabecc53d134ed1782e5612e64580'>2a09617 ^
91a75cd ^

2a09617 ^
91a75cd ^





















2a09617 ^



1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50








                                          

                            
             
                                  

 





                                                                              

 
                                                                          





















                                                        



                                                                  
package account

import (
	"errors"
	"fmt"

	"git.sr.ht/~sircmpwn/aerc/widgets"
)

type NextPrevResult struct{}

func init() {
	register(NextPrevResult{})
}

func (_ NextPrevResult) Aliases() []string {
	return []string{"next-result", "prev-result"}
}

func (_ NextPrevResult) Complete(aerc *widgets.Aerc, args []string) []string {
	return nil
}

func (_ NextPrevResult) Execute(aerc *widgets.Aerc, args []string) error {
	if len(args) > 1 {
		return nextPrevResultUsage(args[0])
	}
	acct := aerc.SelectedAccount()
	if acct == nil {
		return errors.New("No account selected")
	}
	if args[0] == "prev-result" {
		store := acct.Store()
		if store != nil {
			store.PrevResult()
		}
		acct.Messages().Scroll()
	} else {
		store := acct.Store()
		if store != nil {
			store.NextResult()
		}
		acct.Messages().Scroll()
	}
	return nil
}

func nextPrevResultUsage(cmd string) error {
	return errors.New(fmt.Sprintf("Usage: %s [<n>[%%]]", cmd))
}
"c1">//:: Check that the different operands of an instruction aren't too large for their bitfields. :(scenario check_bitfield_sizes) % Hide_errors = true; == 0x1 01/add 4/mod 3/rm32 1/r32 # add ECX to EBX +error: '4/mod' too large to fit in bitfield mod :(before "End Globals") map<string, uint32_t> Operand_bound; :(before "End One-time Setup") put_new(Operand_bound, "subop", 1<<3); put_new(Operand_bound, "mod", 1<<2); put_new(Operand_bound, "rm32", 1<<3); put_new(Operand_bound, "base", 1<<3); put_new(Operand_bound, "index", 1<<3); put_new(Operand_bound, "scale", 1<<2); put_new(Operand_bound, "r32", 1<<3); put_new(Operand_bound, "disp8", 1<<8); put_new(Operand_bound, "disp16", 1<<16); // no bound needed for disp32 put_new(Operand_bound, "imm8", 1<<8); // no bound needed for imm32 :(before "Pack Operands(segment code)") check_operand_bounds(code); if (trace_contains_errors()) return; :(code) void check_operand_bounds(const segment& code) { trace(99, "transform") << "-- check operand bounds" << end(); for (int i = 0; i < SIZE(code.lines); ++i) { const line& inst = code.lines.at(i); for (int j = first_operand(inst); j < SIZE(inst.words); ++j) check_operand_bounds(inst.words.at(j)); if (trace_contains_errors()) return; // stop at the first mal-formed instruction } } void check_operand_bounds(const word& w) { for (map<string, uint32_t>::iterator p = Operand_bound.begin(); p != Operand_bound.end(); ++p) { if (!has_operand_metadata(w, p->first)) continue; if (!looks_like_hex_int(w.data)) continue; // later transforms are on their own to do their own bounds checking int32_t x = parse_int(w.data); if (x >= 0) { if (static_cast<uint32_t>(x) >= p->second) raise << "'" << w.original << "' too large to fit in bitfield " << p->first << '\n' << end(); } else { // hacky? assuming bound is a power of 2 if (x < -1*static_cast<int32_t>(p->second/2)) raise << "'" << w.original << "' too large to fit in bitfield " << p->first << '\n' << end(); } } }